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 Setting for sending emails

SMTP Setting for sending emails

Scheduled Pinned Locked Moved ASP.NET
htmldata-structures
6 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.
  • S Offline
    S Offline
    Software_Guy_123
    wrote on last edited by
    #1

    Hello, I am using below code for sending emails, I am getting email in mailroot queue, my system is connected to internet, what settings need to be done so email can send to valid email Id. Imports System.Web Imports System.Web.Mail Function sendMail(ByVal i_strFromId As String, ByVal i_strToId As String, ByVal i_strCCId As String, ByVal i_strSubject As String, ByVal i_strMsg As String) Dim objMail As New MailMessage() If Len(i_strFromId) > 0 Then objMail.From = i_strFromId If Len(i_strToId) > 0 Then objMail.To = i_strToId If Len(i_strCCId) > 0 Then objMail.Cc = i_strCCId objMail.BodyFormat = MailFormat.Html objMail.Subject = i_strSubject objMail.Body = i_strMsg SmtpMail.Send(objMail) End Function Best Regards, S Kumar

    N R 2 Replies Last reply
    0
    • S Software_Guy_123

      Hello, I am using below code for sending emails, I am getting email in mailroot queue, my system is connected to internet, what settings need to be done so email can send to valid email Id. Imports System.Web Imports System.Web.Mail Function sendMail(ByVal i_strFromId As String, ByVal i_strToId As String, ByVal i_strCCId As String, ByVal i_strSubject As String, ByVal i_strMsg As String) Dim objMail As New MailMessage() If Len(i_strFromId) > 0 Then objMail.From = i_strFromId If Len(i_strToId) > 0 Then objMail.To = i_strToId If Len(i_strCCId) > 0 Then objMail.Cc = i_strCCId objMail.BodyFormat = MailFormat.Html objMail.Subject = i_strSubject objMail.Body = i_strMsg SmtpMail.Send(objMail) End Function Best Regards, S Kumar

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Set the SmtpMail.SmtpServer property to a valid email server

      only two letters away from being an asset

      S 1 Reply Last reply
      0
      • N Not Active

        Set the SmtpMail.SmtpServer property to a valid email server

        only two letters away from being an asset

        S Offline
        S Offline
        Software_Guy_123
        wrote on last edited by
        #3

        Hello, I had tried with SmtpMail.Smtpserver = "mail.valid.com" ' Valid smtpmail server then also it is not working Any setting require for SMTP server like SmartHost or anything ? Please advise. Best Regards, S Kumar

        N S 2 Replies Last reply
        0
        • S Software_Guy_123

          Hello, I had tried with SmtpMail.Smtpserver = "mail.valid.com" ' Valid smtpmail server then also it is not working Any setting require for SMTP server like SmartHost or anything ? Please advise. Best Regards, S Kumar

          N Offline
          N Offline
          Not Active
          wrote on last edited by
          #4

          When you say "is not working" what do you mean? Are you getting an exception, is the mail not being sent?

          only two letters away from being an asset

          1 Reply Last reply
          0
          • S Software_Guy_123

            Hello, I had tried with SmtpMail.Smtpserver = "mail.valid.com" ' Valid smtpmail server then also it is not working Any setting require for SMTP server like SmartHost or anything ? Please advise. Best Regards, S Kumar

            S Offline
            S Offline
            Software_Guy_123
            wrote on last edited by
            #5

            Hi, I am getting email in Mailroot/Queue, if I am using valid email id it is not sending email. Regards, SKumar

            1 Reply Last reply
            0
            • S Software_Guy_123

              Hello, I am using below code for sending emails, I am getting email in mailroot queue, my system is connected to internet, what settings need to be done so email can send to valid email Id. Imports System.Web Imports System.Web.Mail Function sendMail(ByVal i_strFromId As String, ByVal i_strToId As String, ByVal i_strCCId As String, ByVal i_strSubject As String, ByVal i_strMsg As String) Dim objMail As New MailMessage() If Len(i_strFromId) > 0 Then objMail.From = i_strFromId If Len(i_strToId) > 0 Then objMail.To = i_strToId If Len(i_strCCId) > 0 Then objMail.Cc = i_strCCId objMail.BodyFormat = MailFormat.Html objMail.Subject = i_strSubject objMail.Body = i_strMsg SmtpMail.Send(objMail) End Function Best Regards, S Kumar

              R Offline
              R Offline
              RaghuSanta
              wrote on last edited by
              #6

              In the web.config, add a key under appsettings. The value should be the ip address of the machine which is hosting. If local machine, then put localhost. Then in your sendmail function add one more line before smtpmail.send. SmtpMail.SmtpServer = ConfigurationSettings.AppSettings("smtpServerName") SmtpMail.Send(objMail) Regards, Raghu.

              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