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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Smtp Mail

Smtp Mail

Scheduled Pinned Locked Moved ASP.NET
csharphtmlasp-nethelp
4 Posts 4 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.
  • P Offline
    P Offline
    pinna_hari
    wrote on last edited by
    #1

    Hello, I developed a small application in Asp.Net to send a mail... i wrote

    SmtpMail.SmtpServer = "localhost";

    when am trying to send a mail my program is executing and i am getting result your mail sent successfully... But the mail is not sending,... Mainly my problem is,What i have to use smtpserver..... This is the code am writing totally MailMessage objEmail = new MailMessage(); objEmail.To = txtTo.Text; objEmail.From = txtFrom.Text; objEmail.Subject = "Test"; objEmail.Body = txtName.Text + ", " +txtComments.Text; objEmail.Priority = MailPriority.High; objEmail.BodyFormat = MailFormat.Html; SmtpMail.SmtpServer = "localhost"; SmtpMail.Send(objEmail); Response.Write("Your Email has been sent sucessfully - Thank You");

    Pinna

    N G N 3 Replies Last reply
    0
    • P pinna_hari

      Hello, I developed a small application in Asp.Net to send a mail... i wrote

      SmtpMail.SmtpServer = "localhost";

      when am trying to send a mail my program is executing and i am getting result your mail sent successfully... But the mail is not sending,... Mainly my problem is,What i have to use smtpserver..... This is the code am writing totally MailMessage objEmail = new MailMessage(); objEmail.To = txtTo.Text; objEmail.From = txtFrom.Text; objEmail.Subject = "Test"; objEmail.Body = txtName.Text + ", " +txtComments.Text; objEmail.Priority = MailPriority.High; objEmail.BodyFormat = MailFormat.Html; SmtpMail.SmtpServer = "localhost"; SmtpMail.Send(objEmail); Response.Write("Your Email has been sent sucessfully - Thank You");

      Pinna

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Do you have SMTP server running on "localhost" ?

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

      1 Reply Last reply
      0
      • P pinna_hari

        Hello, I developed a small application in Asp.Net to send a mail... i wrote

        SmtpMail.SmtpServer = "localhost";

        when am trying to send a mail my program is executing and i am getting result your mail sent successfully... But the mail is not sending,... Mainly my problem is,What i have to use smtpserver..... This is the code am writing totally MailMessage objEmail = new MailMessage(); objEmail.To = txtTo.Text; objEmail.From = txtFrom.Text; objEmail.Subject = "Test"; objEmail.Body = txtName.Text + ", " +txtComments.Text; objEmail.Priority = MailPriority.High; objEmail.BodyFormat = MailFormat.Html; SmtpMail.SmtpServer = "localhost"; SmtpMail.Send(objEmail); Response.Write("Your Email has been sent sucessfully - Thank You");

        Pinna

        G Offline
        G Offline
        Gayani Devapriya
        wrote on last edited by
        #3

        Hi, An SMTP server is a computer that receives outgoing mail messages from users and routes them to their intended recipients. So I would like to know whether the mechine that you are working now, does it fall to this category? If not find out the mail server IP Address/Name and use it instead. Thx, Gayani

        1 Reply Last reply
        0
        • P pinna_hari

          Hello, I developed a small application in Asp.Net to send a mail... i wrote

          SmtpMail.SmtpServer = "localhost";

          when am trying to send a mail my program is executing and i am getting result your mail sent successfully... But the mail is not sending,... Mainly my problem is,What i have to use smtpserver..... This is the code am writing totally MailMessage objEmail = new MailMessage(); objEmail.To = txtTo.Text; objEmail.From = txtFrom.Text; objEmail.Subject = "Test"; objEmail.Body = txtName.Text + ", " +txtComments.Text; objEmail.Priority = MailPriority.High; objEmail.BodyFormat = MailFormat.Html; SmtpMail.SmtpServer = "localhost"; SmtpMail.Send(objEmail); Response.Write("Your Email has been sent sucessfully - Thank You");

          Pinna

          N Offline
          N Offline
          NetBot
          wrote on last edited by
          #4

          Don`t worry... Its ust a security constraint.You mail won`t be sent,but stored in the "C:\Inetpub\mailroot\Queue" folder. Once you deploy ur application on production server, just change the settings from localhost to your smtp server.

          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