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 in c# code(asp.net 1.1)?

Send mail in c# code(asp.net 1.1)?

Scheduled Pinned Locked Moved ASP.NET
csharphelpasp-netcomquestion
6 Posts 5 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
    ahmadnaghsh
    wrote on last edited by
    #1

    i want to mail welcome message when a user register in my web site. i use the below code but it does'nt work. it's give me this error : (The"SendUsing" configuration value is invalid.) public static void Send(string mail,string sname,string sfamily) { MailMessage mailMsg = new MailMessage(); mailMsg .From = "info@mashhad915.com"; mailMsg .To =mail; mailMsg .Subject = "Welcome!"; mailMsg .Body ="welcome"; mailMsg.Bcc="info@mashhad915.com"; mailMsg.Cc="info@mashhad915.com"; SmtpMail.SmtpServer.Insert(0,"127.0.0.1"); SmtpMail.Send(mailMsg ); } please help me? it's very important for me.

    B T P V 5 Replies Last reply
    0
    • A ahmadnaghsh

      i want to mail welcome message when a user register in my web site. i use the below code but it does'nt work. it's give me this error : (The"SendUsing" configuration value is invalid.) public static void Send(string mail,string sname,string sfamily) { MailMessage mailMsg = new MailMessage(); mailMsg .From = "info@mashhad915.com"; mailMsg .To =mail; mailMsg .Subject = "Welcome!"; mailMsg .Body ="welcome"; mailMsg.Bcc="info@mashhad915.com"; mailMsg.Cc="info@mashhad915.com"; SmtpMail.SmtpServer.Insert(0,"127.0.0.1"); SmtpMail.Send(mailMsg ); } please help me? it's very important for me.

      B Offline
      B Offline
      Bijgupt
      wrote on last edited by
      #2

      check ur smtp configuration, it might be not properly configured.

      1 Reply Last reply
      0
      • A ahmadnaghsh

        i want to mail welcome message when a user register in my web site. i use the below code but it does'nt work. it's give me this error : (The"SendUsing" configuration value is invalid.) public static void Send(string mail,string sname,string sfamily) { MailMessage mailMsg = new MailMessage(); mailMsg .From = "info@mashhad915.com"; mailMsg .To =mail; mailMsg .Subject = "Welcome!"; mailMsg .Body ="welcome"; mailMsg.Bcc="info@mashhad915.com"; mailMsg.Cc="info@mashhad915.com"; SmtpMail.SmtpServer.Insert(0,"127.0.0.1"); SmtpMail.Send(mailMsg ); } please help me? it's very important for me.

        T Offline
        T Offline
        talk2prabir yahoo co in
        wrote on last edited by
        #3

        Use smtpserver out blank as below: SmtpMail.SmtpServer=""; or give ur smtp server according to ur smtp out as like below : SmtpMail.SmtpServer="mail.a2z.com" prabir

        1 Reply Last reply
        0
        • A ahmadnaghsh

          i want to mail welcome message when a user register in my web site. i use the below code but it does'nt work. it's give me this error : (The"SendUsing" configuration value is invalid.) public static void Send(string mail,string sname,string sfamily) { MailMessage mailMsg = new MailMessage(); mailMsg .From = "info@mashhad915.com"; mailMsg .To =mail; mailMsg .Subject = "Welcome!"; mailMsg .Body ="welcome"; mailMsg.Bcc="info@mashhad915.com"; mailMsg.Cc="info@mashhad915.com"; SmtpMail.SmtpServer.Insert(0,"127.0.0.1"); SmtpMail.Send(mailMsg ); } please help me? it's very important for me.

          P Offline
          P Offline
          phimix
          wrote on last edited by
          #4

          I had a similar problem a few weeks ago. It helped to set the smtp server to local host and not domain.com or mail.domain.com.

          phi Geek Load - Free Geek Stuff for Everybody :omg:

          1 Reply Last reply
          0
          • A ahmadnaghsh

            i want to mail welcome message when a user register in my web site. i use the below code but it does'nt work. it's give me this error : (The"SendUsing" configuration value is invalid.) public static void Send(string mail,string sname,string sfamily) { MailMessage mailMsg = new MailMessage(); mailMsg .From = "info@mashhad915.com"; mailMsg .To =mail; mailMsg .Subject = "Welcome!"; mailMsg .Body ="welcome"; mailMsg.Bcc="info@mashhad915.com"; mailMsg.Cc="info@mashhad915.com"; SmtpMail.SmtpServer.Insert(0,"127.0.0.1"); SmtpMail.Send(mailMsg ); } please help me? it's very important for me.

            T Offline
            T Offline
            talk2prabir yahoo co in
            wrote on last edited by
            #5

            Hello, In my recent project I used sending mails functions. Actually 2 approaches are their. 1. In this case the mails go to bulk /spam folder 2. In 2nd approach mail will go to inbox(u r using authentication here as u have to mention uid/pwd of sending mailer) I am putting the exact codes that I have written previously. ______________________________________________________ 1st Approach public void SendMail() { MailMessage msgMail=new MailMessage(); msgMail.To=emailTo; msgMail.From="test@test.com"; msgMail.Subject="test visitors mail"; msgMail.Body="whatever u want"; SmtpMail.SmtpServer = ""; SmtpMail.Send(msgMail); } 2nd Approach(same as 1st approach with some additional fields of authentication) public void SendMail() { MailMessage msgMail=new MailMessage(); msgMail.To=emailTo; msgMail.From="test@test.com"; msgMail.Subject="test visitors mail"; msgMail.Subject="test visitors mail"; msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "test@test.com"); //set your username here msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "testpassword"); //set your password here SmtpMail.SmtpServer = "mail.test.com" ;//put ur smtpout here SmtpMail.Send(msgMail); } Thanks, Prabir

            1 Reply Last reply
            0
            • A ahmadnaghsh

              i want to mail welcome message when a user register in my web site. i use the below code but it does'nt work. it's give me this error : (The"SendUsing" configuration value is invalid.) public static void Send(string mail,string sname,string sfamily) { MailMessage mailMsg = new MailMessage(); mailMsg .From = "info@mashhad915.com"; mailMsg .To =mail; mailMsg .Subject = "Welcome!"; mailMsg .Body ="welcome"; mailMsg.Bcc="info@mashhad915.com"; mailMsg.Cc="info@mashhad915.com"; SmtpMail.SmtpServer.Insert(0,"127.0.0.1"); SmtpMail.Send(mailMsg ); } please help me? it's very important for me.

              V Offline
              V Offline
              Vasudevan Deepak Kumar
              wrote on last edited by
              #6

              Check out http://www.systemwebmail.com/[^]

              Vasudevan Deepak Kumar Personal Homepage Tech Gossips

              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