?
Solved

asp.net, email, godaddy

Posted on 2013-06-06
2
Medium Priority
?
581 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 34

Accepted Solution

by:
Paul MacDonald earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

743 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