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. Sending Mail through ASP.NET

Sending Mail through ASP.NET

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netbusinesshelp
6 Posts 6 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
    kaushik490
    wrote on last edited by
    #1

    Hi Gurus, Can any body send me the code of sending Mail through ASP.NET and wht are the requirements for sending a mail. Which Namespace we should import. Using System.Net.Mail Or Using System.Web.Mail Can any one help me out of this Plzzzzzzzz. Plz send me the code Expecting an Early and favourable Reply Thanks in Advance

    with thanks and regards, kaushik pulpa

    K S S N I 5 Replies Last reply
    0
    • K kaushik490

      Hi Gurus, Can any body send me the code of sending Mail through ASP.NET and wht are the requirements for sending a mail. Which Namespace we should import. Using System.Net.Mail Or Using System.Web.Mail Can any one help me out of this Plzzzzzzzz. Plz send me the code Expecting an Early and favourable Reply Thanks in Advance

      with thanks and regards, kaushik pulpa

      K Offline
      K Offline
      kirthikirthi
      wrote on last edited by
      #2

      Hi chk this http://www.codeproject.com/useritems/Email_Sending_Programme.asp[^] http://www.sitepoint.com/article/sending-web-email-asp-net[^] System.Web.Mail Keerthi

      1 Reply Last reply
      0
      • K kaushik490

        Hi Gurus, Can any body send me the code of sending Mail through ASP.NET and wht are the requirements for sending a mail. Which Namespace we should import. Using System.Net.Mail Or Using System.Web.Mail Can any one help me out of this Plzzzzzzzz. Plz send me the code Expecting an Early and favourable Reply Thanks in Advance

        with thanks and regards, kaushik pulpa

        S Offline
        S Offline
        Sathesh Sakthivel
        wrote on last edited by
        #3

        Use the namespace System.Net.Mail,System.Net.Mail.SmtpClient There are lot of examples SMTP[^]in CP itself. This article will help you in creating the SMTP.

        Regards, Satips.

        1 Reply Last reply
        0
        • K kaushik490

          Hi Gurus, Can any body send me the code of sending Mail through ASP.NET and wht are the requirements for sending a mail. Which Namespace we should import. Using System.Net.Mail Or Using System.Web.Mail Can any one help me out of this Plzzzzzzzz. Plz send me the code Expecting an Early and favourable Reply Thanks in Advance

          with thanks and regards, kaushik pulpa

          S Offline
          S Offline
          Sandeep Kumar
          wrote on last edited by
          #4

          Hi, using System.Net.Mail; static string HostName = System.Net.Dns.GetHostName(); System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(); message.To.Add("mrk_hari@yahoo.com"); message.Subject = "This is the Subject line"; message.From = new System.Net.Mail.MailAddress("shkuricheti@gmail.com"); message.Body = "This is the message body"; System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient(HostName); smtp.Send(message); Sandeep Kumar.V

          1 Reply Last reply
          0
          • K kaushik490

            Hi Gurus, Can any body send me the code of sending Mail through ASP.NET and wht are the requirements for sending a mail. Which Namespace we should import. Using System.Net.Mail Or Using System.Web.Mail Can any one help me out of this Plzzzzzzzz. Plz send me the code Expecting an Early and favourable Reply Thanks in Advance

            with thanks and regards, kaushik pulpa

            N Offline
            N Offline
            Nouman Bhatti
            wrote on last edited by
            #5

            the reply from sandeep works fine

            1 Reply Last reply
            0
            • K kaushik490

              Hi Gurus, Can any body send me the code of sending Mail through ASP.NET and wht are the requirements for sending a mail. Which Namespace we should import. Using System.Net.Mail Or Using System.Web.Mail Can any one help me out of this Plzzzzzzzz. Plz send me the code Expecting an Early and favourable Reply Thanks in Advance

              with thanks and regards, kaushik pulpa

              I Offline
              I Offline
              Ibuprofen
              wrote on last edited by
              #6

              here is that what you are looking for? Sometimes links are good, but thats my biggest problem with alot of people on CodeProject, most of us are smart enough to google, and if I come here, its because chances are I didnt understand what they were explaining out there. It helps to see real life code, so here is an example for you from one of my projects. private void SendEmail() { try { //create email message MailMessage newMail = new MailMessage(); newMail.From="e-mail@e-mail.com"; newMail.From="e-mail@e-mail.com"; newMail.To=lblEmail.Text; newMail.Subject="Your TCAIMS Password"; newMail.Body="Your password is "+lblPassword.Text+"."; SmtpMail.SmtpServer="SMTP IP ADDRESS HERE"; SmtpMail.Send(newMail); newMail = new MailMessage(); newMail.From="e-mail@e-mail.com"; newMail.To=lblEmail.Text; newMail.Subject="Your User ID"; newMail.Body="Your User ID is "+lblUserID.Text+"."; SmtpMail.SmtpServer="SMTP SERVER IP"; SmtpMail.Send(newMail); } catch(Exception err) { string s = err.Message; HandleErrors(s); } }

              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