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

Expert Comment

by:Dave Baldwin
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
padas, your answer is silly.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
Comment Utility
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
Comment Utility
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 82

Expert Comment

by:Dave Baldwin
Comment Utility
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
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
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 …

744 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

17 Experts available now in Live!

Get 1:1 Help Now