Solved

using godaddy as service I send the mail.  However, the mail do not appear at the To email address

Posted on 2013-12-14
12
425 Views
Last Modified: 2014-01-02
using godaddy as service I send the mail.  However, the mail do not appear at the To email address.  Instead the mail appears in the in folder my email account on Godaddy on the application.

I would like to see the mail in the sent folder in my account and to the To email account.

Please help. Thanks


public static void sendmail(string strFrom, string strToName, string strTo, string strSubject, string strBody)
        {
            MailMessage EmailMsg = new MailMessage();
            EmailMsg.From = new MailAddress(strFrom,strFrom);
           
            EmailMsg.To.Add(new MailAddress(strToName, strTo));
            EmailMsg.Subject = strSubject;
            EmailMsg.Body = strBody;
            EmailMsg.IsBodyHtml = true;
            // EmailMsg.Priority = MailPriority.Normal;

            SmtpClient MailClient = new SmtpClient();
            MailClient.Send(EmailMsg);

            // HttpContext.Current.Response.Redirect("mailsent.aspx");

        }
0
Comment
Question by:goodk
  • 5
  • 3
  • 2
12 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39719408
None of the many emails I have sent from my Godaddy web site have ever ended up in my 'Sent Items' folder.  None of the ones that have sent with a desktop email client are there either.  Only the ones that you send thru the WebMail service end up there on their servers.

I was told by Godaddy at one time that either the To or the From address had to be a valid email account on Godaddy.  That's the way it seems to work on my Windows hosting there.  It looks like your code is C#.NET but it doesn't look complete.  This is the closest I could find to your code: http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage%28v=vs.110%29.aspx

I suggest you click on "Request Attention" and get the C# and .NET Topic Areas added to your question.  The Email Servers and Email Protocols Topic Areas are not really about writing code like this.
0
 

Author Comment

by:goodk
ID: 39720335
The code is typical and does not have any errors.  What I do not understand is how Godaddy software is set up to address email sent?
0
 

Author Comment

by:goodk
ID: 39732542
myCLib.gMail.sendmail("info@right-match.com","info@right-match.com","info@right-match.com", "teststrsubject", "teststrbody");
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39733934
You have this line

 EmailMsg.To.Add(new MailAddress(strToName, strTo));

and that needs to be an email address.  Trace what strTo is and that will be your answer.
0
 

Author Comment

by:goodk
ID: 39734316
padas, your answer is silly.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39734317
Sometimes the dumb things work....  

> mail do not appear at the To email address.  Instead the mail appears in the in folder my email account

If the mail is going to your own email address, the first thing to check is where you are sending it to.    Are you 100% sure the variable, 'strTo' is going to the email address you are expecting.  Or am I missing something else.
0
 

Author Comment

by:goodk
ID: 39735236
myCLib.gMail.sendmail("info@right-match.com","xxxx@yahoo.com","xxxx@yahoo.com", "teststrsubject", "teststrbody");


Where xxxx is only an example.

Can you verify if all the statement I wrote are correct to send the mail.  Do I need to provide any other outbound parameter for the mail outbound to work on godaddy server?  

Thanks
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39735269
Yes, you need to identify the SMTP server.  Here is Godaddy's C# example that I just found: http://support.godaddy.com/help/article/1073/using-cdosys-to-send-email-from-your-windows-hosting-account
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 39735320
In your original code you have to top, and the bottom is what you just posted.  Notice they are not the same format.   This is way I like to be silly and start with the most basic first.   I use CDO to send mail all the time although not in C but is is very similar.  

The top looks like you have a function for MailAddress and the bottom looks like you have a function for sendmail.  Which is the actual function you are using and what does each field do?  

I assume the bottom is the actual and I see 5 fields being passed.  I assume in order you have:
From:info@right-match.com
To_Name:xxxx@yahoo.com
To_Email:xxxx@yahoo.com
Subject:teststrsubject
Body:teststrbody

When testing are you using your own xxxx@yahoo.com? or by mistake is the "to" field, nfo@right-match.com?

 EmailMsg.To.Add(new MailAddress(strToName, strTo));

myCLib.gMail.sendmail("info@right-match.com","xxxx@yahoo.com","xxxx@yahoo.com", "teststrsubject", "teststrbody");
0
 

Author Closing Comment

by:goodk
ID: 39752296
I had everything correct.

It appear that the out email address GoDaddy has assigned is not part of the web account.  It is still map to the main account.

I have talked to few people at Godaddy.com but I am getting a run around.

When I put out email address from other web account it works.

Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now