How to Mail Send from asp.net to server

Posted by Jayakumars under Regular Expressions on 3/25/2011 | Points: 10 | Views : 2492 | Status : [Member] [MVP] | Replies : 3
Hi


How to Mail Send Asp.net , C# i did not achieve

Mark as Answer if its helpful to you


Responses

Posted by: Prabhakar on: 3/25/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hi jayakumars


i am do this in my article want to see that . .

here is code & article link

SmtpClient smtpClient = new SmtpClient();

smtpClient.Host = "smtp.gmail.com";

smtpClient.UseDefaultCredentials = false;

smtpClient.EnableSsl = true;

smtpClient.Credentials = new NetworkCredential(txtid.Text, txtpassword.Text);

smtpClient.Port = 25;



MailAddress fromAddress = new MailAddress(txtid.Text, txtname.Text);

MailMessage message = new MailMessage();

message.From = fromAddress;

message.To.Add(new MailAddress(GridView1.Rows[i].Cells[5].Text));

message.Subject = "TestMail1";

//message.CC.Add("prem@gmail.com");

message.IsBodyHtml = true;

string msg = " I am " + GridView1.Rows[i].Cells[2].Text + " My Email :" + GridView1.Rows[i].Cells[5].Text + "<br/> and <br/>My Enquiry " + txtfeedback.Text;

message.Body = msg;

smtpClient.Send(message);

lblstatus.Text = "Email successfully sent.";


http://www.dotnetfunda.com/articles/article1162-import-gmail-contacts-in-gridview-and-send-mail-to-selected-email-ids-.aspx

Best Regard's
Prabhakar

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vforvijay on: 3/25/2011 [Member] Starter | Points: 25

Up
0
Down
Hi

try this link....http://vbdotnetaddict.blogspot.com/2011/01/send-email-by-using-vbnet-coding.html

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: SheoNarayan on: 3/25/2011 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Hi Jaya,

Hope you are now able to send the email. In case you need a detailed article on this topic along with sending email with an attachment, read this article http://www.dotnetfunda.com/articles/article1106-sending-email-with-attachment-in-aspnet-.aspx.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Jayakumars, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response