Solved

asp.net, email, godaddy

Posted on 2013-06-06
2
547 Views
Last Modified: 2013-06-07
I need to send email by using GoDaddy.com hosting. and have two questions.

1. The following code does not work emailing. any idea why?
2. If the following codes are resided my house server(window 2008), will the smtp email still working? Or the codes have to reside in godaddy hosting?

thanks

  public static string SendEmail(string from, string to, string subject, string body)
        {
            try
            {
                MailMessage MessageInfo = new MailMessage(from,to,subject,body);
                MessageInfo.IsBodyHtml = true;
                SmtpClient EmailClient = new SmtpClient("relay-hosting.secureserver.net");
                System.Net.NetworkCredential SMTPUserInfo = new System.Net.NetworkCredential("smtp01@test.com", "pwd");
                EmailClient.UseDefaultCredentials = false;
                EmailClient.Credentials = SMTPUserInfo;
                EmailClient.Send(MessageInfo);
                return "Send";
                //smtp01@evidiabio.com
                //Success@1368
            }
            catch
            {
                return "Unable to send email";
            }
        }
0
Comment
Question by:solution1368
  • 2
2 Comments
 
LVL 34

Accepted Solution

by:
Paul MacDonald earned 500 total points
ID: 39226809
You're in a TRY...CATCH - what's the error message being returned?  Use...
     catch (Exception e)
...to get the exception.
0
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 39228895
Thanks for the points.  I hope you were able to resolve your problem!
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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 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

13 Experts available now in Live!

Get 1:1 Help Now