Configuring smtp mailSettingsMSMilton Smith18yAsked May 16, 2008, 1:46 PM EDT6 answersShareLinkedInXCopy linkSaveHow do i configure smtp mailsettings in web.config?5 AnswersKnow the answer? Post it. Somebody with the same question will find it here.Niradhip ChakrabortyRank #428 · 5.8K points18y agoPosted May 16, 2008, 1:52 PM EDT0<system.net> <mailSettings> <smtp> <network host="SMTP.1and1.com" userName="[email protected]" password="sam"/> </smtp> </mailSettings> </system.net> change the host name username and password as per your need.0MSMilton Smith38 points18y agoPosted May 16, 2008, 1:58 PM EDT0Thanks james can you give me the code to send mail.0Niradhip ChakrabortyRank #428 · 5.8K points18y agoPosted May 16, 2008, 2:02 PM EDT0JavaCopystring strFrom = null; strFrom =" [email protected]"; strTo= " [email protected]"; MailMessage mlMsg = new MailMessage(strTo, strFrom); mlMsg.Subject = "Request for the Information"; SmtpClient emailClient = new SmtpClient(); emailClient.Send(mlMsg);0MSMilton Smith38 points18y agoPosted May 16, 2008, 2:11 PM EDT0Thank you James for your reply. But I am geting error!!!!!!!!! oops. Do I need to add anything more.0Niradhip ChakrabortyRank #428 · 5.8K points18y agoPosted May 16, 2008, 2:14 PM EDT0Please add the namespace using System.Net.Mail;01 short replyMSMilton Smith38 points18y agoPosted May 16, 2008, 2:18 PM EDT0Thanks James. Works fine.0Join to answer this questionEvery answer you publish earns 20 SHARP.Create free accountSign in
Configuring smtp mailSettingsMSMilton Smith18yAsked May 16, 2008, 1:46 PM EDT6 answersShareLinkedInXCopy linkSaveHow do i configure smtp mailsettings in web.config?
Niradhip ChakrabortyRank #428 · 5.8K points18y agoPosted May 16, 2008, 1:52 PM EDT0<system.net> <mailSettings> <smtp> <network host="SMTP.1and1.com" userName="[email protected]" password="sam"/> </smtp> </mailSettings> </system.net> change the host name username and password as per your need.0
MSMilton Smith38 points18y agoPosted May 16, 2008, 1:58 PM EDT0Thanks james can you give me the code to send mail.0
Niradhip ChakrabortyRank #428 · 5.8K points18y agoPosted May 16, 2008, 2:02 PM EDT0JavaCopystring strFrom = null; strFrom =" [email protected]"; strTo= " [email protected]"; MailMessage mlMsg = new MailMessage(strTo, strFrom); mlMsg.Subject = "Request for the Information"; SmtpClient emailClient = new SmtpClient(); emailClient.Send(mlMsg);0
MSMilton Smith38 points18y agoPosted May 16, 2008, 2:11 PM EDT0Thank you James for your reply. But I am geting error!!!!!!!!! oops. Do I need to add anything more.0
Niradhip ChakrabortyRank #428 · 5.8K points18y agoPosted May 16, 2008, 2:14 PM EDT0Please add the namespace using System.Net.Mail;0
Niradhip ChakrabortyRank #428 · 5.8K pointsPosted May 16, 2008, 1:52 PM EDT
<system.net>
<mailSettings>
<smtp>
<network host="SMTP.1and1.com" userName="[email protected]" password="sam"/>
</smtp>
</mailSettings>
</system.net>
change the host name username and password as per your need.
Milton Smith38 pointsPosted May 16, 2008, 1:58 PM EDT
Niradhip ChakrabortyRank #428 · 5.8K pointsPosted May 16, 2008, 2:02 PM EDT
string strFrom = null; strFrom =" [email protected]"; strTo= " [email protected]"; MailMessage mlMsg = new MailMessage(strTo, strFrom); mlMsg.Subject = "Request for the Information"; SmtpClient emailClient = new SmtpClient(); emailClient.Send(mlMsg);Milton Smith38 pointsPosted May 16, 2008, 2:11 PM EDT
Niradhip ChakrabortyRank #428 · 5.8K pointsPosted May 16, 2008, 2:14 PM EDT
Please add the namespace
using System.Net.Mail;
1 short reply
Milton Smith38 pointsPosted May 16, 2008, 2:18 PM EDT