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. Sending email getting problem

Sending email getting problem

Scheduled Pinned Locked Moved ASP.NET
helpcsharpasp-netcomsysadmin
2 Posts 2 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.
  • J Offline
    J Offline
    Jagz W
    wrote on last edited by
    #1

    Hi all I am using ASP.Net 3.5 and send email using smtp server when i host my application i am getting the below error: The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for name@domain.com My Code::: Dim objMail As New MailMessage Try objMail.From = "name@domain.com" objMail.To = "name@domain.com" objMail.BodyFormat = MailFormat.Text objMail.Priority = MailPriority.High objMail.Subject = "My first ASP.NET email" objMail.Body = "This is my first email sent via " SmtpMail.SmtpServer = "server ip address" SmtpMail.Send(objMail) Catch ex As Exception Response.Write(ex.Message) End Try Thanks in advance

    Er. Jagwinder Singh

    T 1 Reply Last reply
    0
    • J Jagz W

      Hi all I am using ASP.Net 3.5 and send email using smtp server when i host my application i am getting the below error: The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for name@domain.com My Code::: Dim objMail As New MailMessage Try objMail.From = "name@domain.com" objMail.To = "name@domain.com" objMail.BodyFormat = MailFormat.Text objMail.Priority = MailPriority.High objMail.Subject = "My first ASP.NET email" objMail.Body = "This is my first email sent via " SmtpMail.SmtpServer = "server ip address" SmtpMail.Send(objMail) Catch ex As Exception Response.Write(ex.Message) End Try Thanks in advance

      Er. Jagwinder Singh

      T Offline
      T Offline
      tech603
      wrote on last edited by
      #2

      You may need to authenticate to your email server so you would need to add that to your code. Below is a code snippet using cdosys, that i tested answering a similar question the other day. Set myMail=CreateObject("CDO.Message") myMail.Subject="Sending email with CDO" myMail.From="youremail@yourdomain.com" myMail.To="youremail@yourdomain.com" myMail.TextBody="This is a message." myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2 'Name or IP of remote SMTP server myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver")="youremailserver" 'Server port myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25 'authenticate myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'email address for authentication myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "youremailaddresshere" 'email password myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "youremailpasswordhere" myMail.Configuration.Fields.Update myMail.Send set myMail=nothing Hope this helps

      Matthew Vass QA Analyst mvass@hostmysite.com HostMySite.com

      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