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. General Programming
  3. C#
  4. Sending email

Sending email

Scheduled Pinned Locked Moved C#
helpcomsysadminquestionworkspace
3 Posts 3 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.
  • A Offline
    A Offline
    ap_sa
    wrote on last edited by
    #1

    hi everyone, i am trying to sent email from my web application using System.web.mail the problem is i am using different smtp server which reuired authontication. my question is how would i set user name, password and the server. here what i have done but it not working, and i runing this project from my local host. oEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); oEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "abc@ab.com"); oEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "******"); SmtpMail.SmtpServer = "smtp.servername.com"; plz help me. i am doing this project for free for some non-profit company and need to finish this project ASAP. Thank you,

    L M 2 Replies Last reply
    0
    • A ap_sa

      hi everyone, i am trying to sent email from my web application using System.web.mail the problem is i am using different smtp server which reuired authontication. my question is how would i set user name, password and the server. here what i have done but it not working, and i runing this project from my local host. oEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); oEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "abc@ab.com"); oEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "******"); SmtpMail.SmtpServer = "smtp.servername.com"; plz help me. i am doing this project for free for some non-profit company and need to finish this project ASAP. Thank you,

      L Offline
      L Offline
      louthy
      wrote on last edited by
      #2

      int cdoBasic = 1; int cdoSendUsingPort = 2; if( useAuth ) { msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", cdoBasic); msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", user); msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", pass); msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", cdoSendUsingPort); msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", server); msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout", 10); msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25); msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", false); }

      1 Reply Last reply
      0
      • A ap_sa

        hi everyone, i am trying to sent email from my web application using System.web.mail the problem is i am using different smtp server which reuired authontication. my question is how would i set user name, password and the server. here what i have done but it not working, and i runing this project from my local host. oEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); oEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "abc@ab.com"); oEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "******"); SmtpMail.SmtpServer = "smtp.servername.com"; plz help me. i am doing this project for free for some non-profit company and need to finish this project ASAP. Thank you,

        M Offline
        M Offline
        MSNFans
        wrote on last edited by
        #3

        Hi ap_sa, I'm very pleasure to tell you. Now Please try it: MailMessage mm = new MailMessage(); mm.From = "your mail address"; mm.To = "Other mail"; mm.Subject = "mail title"; mm.BodyFormat = MailFormat.Html; mm.BodyEncoding = System.Text.Encoding.Default; mm.Body = "Your mail text"; mm.Fields.Add("http://schemas.microsoft.com/cdo/smtpauthenticate","1"); mm.Fields.Add("http://schemas.microsoft.com/cdo/sendusername","yourname"); mm.Fields.Add("http://schemas.microsoft.com/cdo/sendpassword","yourpwd"); SmtpMail.SmtpServer = "smtp.abc.com"; SmtpMail.Send(mm); OK! The End! Happy you daily! :) ————————————————————————————————————    The Opportunity Knows But Once!

        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