Send Mail in ASP.Net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • agarwalsunitadhn
    New Member
    • Jan 2008
    • 82

    Send Mail in ASP.Net

    hello...
    I want to send mail. I got the code for sending mail but here i have to specify the IP of smtpClient. How will i specify this property.

    I got the following code:
    Code:
    MailMessage message = new MailMessage(txtFrom.Text, txtTo.Text, txtSubject.Text, txtBody.Text);
       SmtpClient emailClient = new SmtpClient(txtSMTPServer.Text);
       emailClient.Send(message);
       litStatus.Text = "Message Sent";
    what i have to specify in the txtSMTPServer textbox
    please give me the code of this one
  • Shashi Sadasivan
    Recognized Expert Top Contributor
    • Aug 2007
    • 1435

    #2
    txtSMTPServer.T ext is the smtp server through whcih you wish to send the mail through.

    something like
    mail.mydomainEm ail.com
    would be an smtp server

    Comment

    Working...