Sending Email Failed

Posted by Self-Innovator under ASP.NET on 4/13/2012 | Points: 10 | Views : 1366 | Status : [Member] | Replies : 3
hi..this is My App
In asp.net i am trying to send an email....The message popups Sending Email Failed pls rectify

OnSendEmailClick Event
   SmtpClient smtpClient = new SmtpClient();
MailMessage message = new MailMessage();
try
{
MailAddress fromAddress = new MailAddress(txtEmail.Text, txtSubject.Text);
smtpClient.Host = "144.16.78.63";//System IP

smtpClient.Port = 25;

message.From = fromAddress;

message.To.Add("admin1@yoursite.com");
message.Subject = "Feedback";

message.CC.Add("admin1@yoursite.com");
message.CC.Add("admin2@yoursite.com");

message.Bcc.Add(new MailAddress("admin3@yoursite.com"));
message.Bcc.Add(new MailAddress("admin4@yoursite.com"));

message.IsBodyHtml = false;

message.Body = txtMessage.Text;

smtpClient.Send(message);

lblStatus.Text = "Email successfully sent.";
}
catch (Exception ex)
{
lblStatus.Text = "Send Email Failed." + ex.Message;
}


Join Hands Change lives
Thanks & Regards
Straight Edge Society



Responses

Posted by: Vuyiswamb on: 4/13/2012 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
This is how its done

http://www.dotnetfunda.com/articles/article747-how-to-send-an-e-mail-using-gmail-in-aspnet.aspx

Thank you for posting at Dotnetfunda
[Administrator]

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vforvijay on: 4/13/2012 [Member] Starter | Points: 25

Up
0
Down
HI..Refer the below link to send mail

http://www.dotnetcode.in/2011/06/how-to-send-mail-with-attachment-in.html

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hariinakoti on: 4/13/2012 [Member] Starter | Points: 25

Up
0
Down
http://forums.asp.net/t/971802.aspx

Thanks & Regards
Hari

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response