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
426 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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
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…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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 …

770 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