Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. send mail via asp.net

send mail via asp.net

Scheduled Pinned Locked Moved ASP.NET
csharphtmlasp-netcomsysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    keroed_edmond
    wrote on last edited by
    #1

    i am trying to send a mail from an asp.net page this is what i did code wise MailMessage mailMessage; mailMessage = new MailMessage(); //set properties mailMessage.To = "mail1@yahoo.com"; mailMessage.From ="mail1_Test@Keroed_corp.com"; //If you want to CC this email to someone else... mailMessage.Cc = "mail2@hotmail.com"; //If you want to BCC this email to someone else... mailMessage.Bcc = "mailingKE@gmail.com"; //Send the email in text format //(to send HTML format, change MailFormat.Text to MailFormat.Html) mailMessage.BodyFormat = MailFormat.Text; //Set the priority - options are High, Low, and Normal mailMessage.Priority = MailPriority.Normal; //set subject mailMessage.Subject ="Test Mail"; //set body string bodyText ="Testing send Mail" + Environment.NewLine + "Hopefull this works"; mailMessage.Body = bodyText; //set smtp mail server SmtpMail.SmtpServer = ""; //send mail SmtpMail.Send(mailMessage); i this works because when i go into C:\Inetpub\mailroot\Queue i see the mails that the page tried to send so i am wondering if i need to do some further configuring to my smtp server in IIS kenny

    G 1 Reply Last reply
    0
    • K keroed_edmond

      i am trying to send a mail from an asp.net page this is what i did code wise MailMessage mailMessage; mailMessage = new MailMessage(); //set properties mailMessage.To = "mail1@yahoo.com"; mailMessage.From ="mail1_Test@Keroed_corp.com"; //If you want to CC this email to someone else... mailMessage.Cc = "mail2@hotmail.com"; //If you want to BCC this email to someone else... mailMessage.Bcc = "mailingKE@gmail.com"; //Send the email in text format //(to send HTML format, change MailFormat.Text to MailFormat.Html) mailMessage.BodyFormat = MailFormat.Text; //Set the priority - options are High, Low, and Normal mailMessage.Priority = MailPriority.Normal; //set subject mailMessage.Subject ="Test Mail"; //set body string bodyText ="Testing send Mail" + Environment.NewLine + "Hopefull this works"; mailMessage.Body = bodyText; //set smtp mail server SmtpMail.SmtpServer = ""; //send mail SmtpMail.Send(mailMessage); i this works because when i go into C:\Inetpub\mailroot\Queue i see the mails that the page tried to send so i am wondering if i need to do some further configuring to my smtp server in IIS kenny

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Does your ISP allow sending mail from any server? Some ISPs only allow sending mail through their SMTP server, to prevent spamming.

      --- single minded; short sighted; long gone;

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups