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
428 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C# LINQ ForEach() question 6 87
ASP Repeater control - onl;y show if flag is true 7 22
How to repeat the data 4 30
Header Font Size in Grid View 6 27
Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

733 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