Mail Send Asp.net Application

Posted by Jayakumars under Regular Expressions on 3/15/2011 | Points: 10 | Views : 10621 | Status : [Member] [MVP] | Replies : 11
hi

I need How to Mail send in asp.net application

Mark as Answer if its helpful to you


Responses

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

Up
0
Down
Hi Jayakumars

if u want ot send mail by asp.net with c# so firstly configure ur Outlook express then . .

write the code below . .

SmtpClient smtpClient = new SmtpClient();

MailMessage message = new MailMessage();
MailAddress fromAddress = new MailAddress(txtemail.Text, "Feedback");
smtpClient.Host = "smtp.gmail.com";
smtpClient.UseDefaultCredentials = false;
smtpClient.EnableSsl = true;
smtpClient.Credentials = new NetworkCredential("prabhakar@gmail.com", "*******");
smtpClient.Port = 25;
message.From = fromAddress;
message.To.Add(new MailAddress("prabhakar@gmail.com"));
message.Subject = "Feedback";
message.CC.Add("bhopal@gmail.com");
message.IsBodyHtml = true;
string msg = " I am " + txtname.Text + " My Email :" + txtemail.Text + "<br/> My Mobile :" + txtmobile.Text + " and <br/>My Enquiry " + txtfeedback.Text;
message.Body = msg;
smtpClient.Send(message);
lblstatus.Text = "Email successfully sent.";


Best Regard's
Prabhakar

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

Posted by: Vuyiswamb on: 3/15/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
Prabhakar dont forget to formart your code through the code tags. we will implemet the point system that takes away the points for people who dont format the code. it is difficult to read.

Thank you for posting at Dotnetfunda
[Administrator]

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

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

Up
0
Down
Hi Vuyiswamb ,


thanks for advising i am update my response. . .

Best Regard's
Prabhakar

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

Posted by: Vuyiswamb on: 3/16/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
Thank you my friend , you are a star :)

Thank you for posting at Dotnetfunda
[Administrator]

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

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

Up
0
Down
Hi Vuyiswamb

it's ok . .

Best Regard's
Prabhakar

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

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

Up
0
Down
Hi
I am using the code for mail sending in C#.
It is working fine on localhost, but giving error on clients server.
I checkd SMTP details of the Client, they are working fine.
But i am getting error on this line

smtpClient.Send(message);


Please help,

Thanks,
Nilkanth


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

Posted by: Jayakumars on: 3/18/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

Prabhakar and Vuyiswamb

same error comes anything configure IIS can you explain step by step . i thnink may be IIS confiqured?

Mark as Answer if its helpful to you

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

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

Up
0
Down
Hi Jayakumars,

You are testing on localhost or on Server?

My problem is solved now.
The problem is at Clients end. The mail server was down for 1 day. That's why it gives error.
The mail server is up and the problem gets solved.


Thanks,
Nilkanth

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

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

Up
0
Down
hi , Jayakumars & Nilkanthn

i think ur problem are short out with provided code . .

Best Regard's
Prabhakar

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

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

Up
0
Down
I have a code ready in C#.
But the problem was with the Client's mail server, it was down.

Now its gets solved...
Thanks.

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

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

Up
0
Down
hi Nilkanthn ...

ok .. i hope u do it . . .

Best Regard's
Prabhakar

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

Login to post response