డాట్ నెట్ ఉపయోగించి మెయిల్ పంపించాలంటే మీరు చేయాల్సింది .
1.Add the following code to web.config file
<appSettings>
<add key="SMTPServer" value="mail.mailserver.com"/>
<add key="SMTPServerUID" value="test@mailserver.com"/>
<add key="SMTPServerPWD" value="passwordtest"/>
<add key="SMTPServerPORT" value="25"/>
</appSettings>
<system.net>
<mailSettings>
<smtp from="test@mailserver.com">
<network host="mail.mailserver.com" password="passwordtest" userName="test@mailserver.com"/>
</smtp>
</mailSettings>
</system.net>
2.Add the following method to where you required in .cs పేజిpublic void SendMail()
{
MailMessage objMail = new MailMessage();
objMail.From = new MailAddress("v_cherukuri@redsalsa.com", "Cherukuri Articles");
if (txtRecipient.Text.Trim() != "")
objMail.To.Add("cherukuri@venkateswarlu.co.in");
objMail.CC.Add("cherukuri@venkateswarlu.co.in");
objMail.Subject = "Article :: ";
objMail.Body = "Hi";
Send(objMail);
}
1 comment:
this is artice is very useful
Post a Comment