By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,611 Members | 1,627 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,611 IT Pros & Developers. It's quick & easy.

smtpmail.send

P: n/a
I'm trying to expand my horizons here by working through an ASP.Net book.
When I do the example that uses:

Line 55: Mail.From = "fe******@graymad.com"
Line 56: SmtpMail.SmtpServer = "localhost"
Line 57: SmtpMail.Send(Mail)

I get:

[COMException (0x8004020f): The server rejected one or more recipient
addresses. The server response was: 550 5.7.1 Unable to relay for
my*****@comcast.net
]

Since both my code and the code from the book failed, I'm assuming there's
something else I need to configure? I show SMTP running under services so
there must be something else I need to do here. The remainder of the
exception follows. Thanks

[TargetInvocationException: Exception has been thrown by the target of an
invocation.]
System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr,
Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
String[] namedParameters) +0
System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
Binder binder, Object target, Object[] args, ParameterModifier[] modifiers,
CultureInfo culture, String[] namedParameters) +473
System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String
methodName, Object[] args) +58

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String
methodName, Object[] args) +111
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1861
System.Web.Mail.SmtpMail.Send(MailMessage message) +153
Chapter_08.SmtpEmail.Button1_Click(Object sender, EventArgs e) in
C:\Microsoft Press\ASPNETSBS\Chapter_08\SmtpEmail.aspx.vb:57
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Sorry, here's a little more detail:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
' Create MailMessage instance, set properties, and send
Dim Mail As New MailMessage

Mail.To = TextBox1.Text
Mail.Cc = TextBox2.Text
Mail.Bcc = TextBox3.Text
Mail.Subject = TextBox4.Text
Mail.Body = TextBox5.Text

' Set the property below to a valid email address
Mail.From = "km****@comcast.net"
SmtpMail.SmtpServer = "localhost"
SmtpMail.Send(Mail)

....

"Bineesh AV" wrote:
where is the TO address
bineesh
"kmbarz" <km****@discussions.microsoft.com> wrote in message
news:E8**********************************@microsof t.com...
I'm trying to expand my horizons here by working through an ASP.Net book.
When I do the example that uses:

Line 55: Mail.From = "fe******@graymad.com"
Line 56: SmtpMail.SmtpServer = "localhost"
Line 57: SmtpMail.Send(Mail)

I get:

[COMException (0x8004020f): The server rejected one or more recipient
addresses. The server response was: 550 5.7.1 Unable to relay for
my*****@comcast.net
]

Since both my code and the code from the book failed, I'm assuming there's
something else I need to configure? I show SMTP running under services so
there must be something else I need to do here. The remainder of the
exception follows. Thanks

[TargetInvocationException: Exception has been thrown by the target of an
invocation.]
System.RuntimeType.InvokeDispMethod(String name, BindingFlags

invokeAttr,
Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
String[] namedParameters) +0
System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
Binder binder, Object target, Object[] args, ParameterModifier[]

modifiers,
CultureInfo culture, String[] namedParameters) +473
System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String
methodName, Object[] args) +58

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String
methodName, Object[] args) +111
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1861
System.Web.Mail.SmtpMail.Send(MailMessage message) +153
Chapter_08.SmtpEmail.Button1_Click(Object sender, EventArgs e) in
C:\Microsoft Press\ASPNETSBS\Chapter_08\SmtpEmail.aspx.vb:57
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo
stBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292


Nov 19 '05 #2

P: n/a
hi,
the possible reason could be that your mail server is not configured to
relay messages from your smtp server or you or the from address does not have
permissions to relay messages. Make sure your mail server allows relaying of
messages from your smtp server or instead try SmtpMail.SmtpServer = ""
instead of localhost and check if it works

--
HTH
srini
http://www.expertszone.com
"kmbarz" wrote:
Sorry, here's a little more detail:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
' Create MailMessage instance, set properties, and send
Dim Mail As New MailMessage

Mail.To = TextBox1.Text
Mail.Cc = TextBox2.Text
Mail.Bcc = TextBox3.Text
Mail.Subject = TextBox4.Text
Mail.Body = TextBox5.Text

' Set the property below to a valid email address
Mail.From = "km****@comcast.net"
SmtpMail.SmtpServer = "localhost"
SmtpMail.Send(Mail)

...

"Bineesh AV" wrote:
where is the TO address
bineesh
"kmbarz" <km****@discussions.microsoft.com> wrote in message
news:E8**********************************@microsof t.com...
I'm trying to expand my horizons here by working through an ASP.Net book.
When I do the example that uses:

Line 55: Mail.From = "fe******@graymad.com"
Line 56: SmtpMail.SmtpServer = "localhost"
Line 57: SmtpMail.Send(Mail)

I get:

[COMException (0x8004020f): The server rejected one or more recipient
addresses. The server response was: 550 5.7.1 Unable to relay for
my*****@comcast.net
]

Since both my code and the code from the book failed, I'm assuming there's
something else I need to configure? I show SMTP running under services so
there must be something else I need to do here. The remainder of the
exception follows. Thanks

[TargetInvocationException: Exception has been thrown by the target of an
invocation.]
System.RuntimeType.InvokeDispMethod(String name, BindingFlags

invokeAttr,
Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
String[] namedParameters) +0
System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
Binder binder, Object target, Object[] args, ParameterModifier[]

modifiers,
CultureInfo culture, String[] namedParameters) +473
System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String
methodName, Object[] args) +58

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String
methodName, Object[] args) +111
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1861
System.Web.Mail.SmtpMail.Send(MailMessage message) +153
Chapter_08.SmtpEmail.Button1_Click(Object sender, EventArgs e) in
C:\Microsoft Press\ASPNETSBS\Chapter_08\SmtpEmail.aspx.vb:57
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo
stBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292


Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.