solution1368
asked on
asp.net, email, godaddy
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,subjec t,body);
MessageInfo.IsBodyHtml = true;
SmtpClient EmailClient = new SmtpClient("relay-hosting. secureserv er.net");
System.Net.NetworkCredenti al SMTPUserInfo = new System.Net.NetworkCredenti al("smtp01 @test.com" , "pwd");
EmailClient.UseDefaultCred entials = false;
EmailClient.Credentials = SMTPUserInfo;
EmailClient.Send(MessageIn fo);
return "Send";
//smtp01@evidiabio.com
//Success@1368
}
catch
{
return "Unable to send email";
}
}
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,subjec
MessageInfo.IsBodyHtml = true;
SmtpClient EmailClient = new SmtpClient("relay-hosting.
System.Net.NetworkCredenti
EmailClient.UseDefaultCred
EmailClient.Credentials = SMTPUserInfo;
EmailClient.Send(MessageIn
return "Send";
//smtp01@evidiabio.com
//Success@1368
}
catch
{
return "Unable to send email";
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks for the points. I hope you were able to resolve your problem!