Sending email in asp.net with C#

Posted by Webmaster under ASP.NET on 9/6/2008 | Views : 1619 | Status : [Administrator] | Replies : 2
how to send mail to more than one id in asp.net,c#

_____________________________
Posted on behalf of Manikandan

Best regards,
Webmaster
http://www.dotnetfunda.com



Responses

Posted by: perfectchourasia-9163 on: 4/3/2012 [Member] Starter | Points: 25

Up
0
Down
http://sandeep-chourasia.blogspot.in/2011/05/send-mail-in-aspnet.html

ER sandeep chourasia
sandeepchrs@yahoo.com (on facebook)
http://www.aspnetcodes.com/

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

Posted by: Webmaster on: 9/6/2008 [Administrator] HonoraryPlatinum

Up
0
Down
use the following code

using System; 

using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.Mail;

partial class testmail
{
private void cmdSend_Click(object sender, System.EventArgs e)
{
MailMessage msg = new MailMessage();
msg.Subject = "Dotnetfunda";
msg.Body = "questions by: " + txtname.Text;
msg.Body += txtinfo.Text;
msg.From = txtsender.Text;
msg.To = "urname@urmailser.com"
if (chkPriority.Checked)
msg.Priority = MailPriority.High;

SmtpMail.SmtpServer = "localhost";
SmtpMail.Send(msg);
Result.Text="mail sent successfully."

}
}



_________________________
Posted on behalf of Majith

Best regards,
Webmaster
http://www.dotnetfunda.com

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

Login to post response