473,732 Members | 2,227 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

smtpmail.send

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******@graym ad.com"
Line 56: SmtpMail.SmtpSe rver = "localhost"
Line 57: SmtpMail.Send(M ail)

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

[TargetInvocatio nException: Exception has been thrown by the target of an
invocation.]
System.RuntimeT ype.InvokeDispM ethod(String name, BindingFlags invokeAttr,
Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
String[] namedParameters ) +0
System.RuntimeT ype.InvokeMembe r(String name, BindingFlags invokeAttr,
Binder binder, Object target, Object[] args, ParameterModifi er[] modifiers,
CultureInfo culture, String[] namedParameters ) +473
System.Web.Mail .LateBoundAcces sHelper.CallMet hod(Object obj, String
methodName, Object[] args) +58

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail .LateBoundAcces sHelper.CallMet hod(Object obj, String
methodName, Object[] args) +111
System.Web.Mail .CdoSysHelper.S end(MailMessage message) +1861
System.Web.Mail .SmtpMail.Send( MailMessage message) +153
Chapter_08.Smtp Email.Button1_C lick(Object sender, EventArgs e) in
C:\Microsoft Press\ASPNETSBS \Chapter_08\Smt pEmail.aspx.vb: 57
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108

System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1292
Nov 19 '05 #1
2 1836
Sorry, here's a little more detail:

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) 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.SmtpSe rver = "localhost"
SmtpMail.Send(M ail)

....

"Bineesh AV" wrote:
where is the TO address
bineesh
"kmbarz" <km****@discuss ions.microsoft. com> wrote in message
news:E8******** *************** ***********@mic rosoft.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******@graym ad.com"
Line 56: SmtpMail.SmtpSe rver = "localhost"
Line 57: SmtpMail.Send(M ail)

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

[TargetInvocatio nException: Exception has been thrown by the target of an
invocation.]
System.RuntimeT ype.InvokeDispM ethod(String name, BindingFlags

invokeAttr,
Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
String[] namedParameters ) +0
System.RuntimeT ype.InvokeMembe r(String name, BindingFlags invokeAttr,
Binder binder, Object target, Object[] args, ParameterModifi er[]

modifiers,
CultureInfo culture, String[] namedParameters ) +473
System.Web.Mail .LateBoundAcces sHelper.CallMet hod(Object obj, String
methodName, Object[] args) +58

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail .LateBoundAcces sHelper.CallMet hod(Object obj, String
methodName, Object[] args) +111
System.Web.Mail .CdoSysHelper.S end(MailMessage message) +1861
System.Web.Mail .SmtpMail.Send( MailMessage message) +153
Chapter_08.Smtp Email.Button1_C lick(Object sender, EventArgs e) in
C:\Microsoft Press\ASPNETSBS \Chapter_08\Smt pEmail.aspx.vb: 57
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108

System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP o
stBackEvent(Str ing eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1292


Nov 19 '05 #2
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.SmtpSe rver = ""
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(B yVal sender As System.Object, ByVal e As
System.EventArg s) 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.SmtpSe rver = "localhost"
SmtpMail.Send(M ail)

...

"Bineesh AV" wrote:
where is the TO address
bineesh
"kmbarz" <km****@discuss ions.microsoft. com> wrote in message
news:E8******** *************** ***********@mic rosoft.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******@graym ad.com"
Line 56: SmtpMail.SmtpSe rver = "localhost"
Line 57: SmtpMail.Send(M ail)

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

[TargetInvocatio nException: Exception has been thrown by the target of an
invocation.]
System.RuntimeT ype.InvokeDispM ethod(String name, BindingFlags

invokeAttr,
Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
String[] namedParameters ) +0
System.RuntimeT ype.InvokeMembe r(String name, BindingFlags invokeAttr,
Binder binder, Object target, Object[] args, ParameterModifi er[]

modifiers,
CultureInfo culture, String[] namedParameters ) +473
System.Web.Mail .LateBoundAcces sHelper.CallMet hod(Object obj, String
methodName, Object[] args) +58

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail .LateBoundAcces sHelper.CallMet hod(Object obj, String
methodName, Object[] args) +111
System.Web.Mail .CdoSysHelper.S end(MailMessage message) +1861
System.Web.Mail .SmtpMail.Send( MailMessage message) +153
Chapter_08.Smtp Email.Button1_C lick(Object sender, EventArgs e) in
C:\Microsoft Press\ASPNETSBS \Chapter_08\Smt pEmail.aspx.vb: 57
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108

System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP o
stBackEvent(Str ing eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1292


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
379
by: Jason | last post by:
Hi not sure if this is the write place, but i really need some help with this...! I have a piece of code that sends email using the SmtpMail class, in an ASP.NET web application, with integrated window authentication. it does work, and works fine on my dev machine. it also works fine on the test server, but with some considerations. on the test server, i can send emails IF they do not include any attachments. as soon as i send an email...
2
2547
by: Leszek | last post by:
Hello, I have created a simple code to send emails using the MailMessage class and the SmtpMail.Send() method: MailMessage mail = new MailMessage(); mail.From = echidna@somewhere.com; // hard-coded mail.To = platypus@somewhere.com; mail.Subject = "Test"; mail.Body = strMessage;
6
2454
by: Cameron Eckman | last post by:
I get various errors when I try to use email on the machine I have. XP professional. It works fine on another machine with NT 2000 server. Below is the code: 'BEGIN CODE Dim oMail As New MailMessage() With oMail .From = "mypc@baxglobal.com" .To = "ceckman@baxglobal.com"
5
2151
by: ElanKathir | last post by:
Hi ! I wrote one code for Send the E-mail, But that code have some problem , So please help me Here i paste my code and Error: Error: Server Error in '/Elan_Sample' Application. --------------------------------------------------------------------------------
2
1799
by: Edward | last post by:
Hello, everybody, I tried to send Email out using ASP.NET, but failed, here is the code of sending: -------------------------------------------------------------------------------- Try Try 'SmtpMail.SmtpServer = "smtp.citiz.net"
1
2698
by: Jens Øster | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send e-mail addresses out side my company walls. When the e-mail is send on some one in my company it works perfect. I think it is a relay issue. Our system administrator will not allow relaying. In the ASP.Net web.config file I let the web application...
3
9256
by: Jens | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send e-mail addresses out side my company walls. When the e-mail is send on some one in my company it works perfect. I think it is a relay issue. Our system administrator will not allow relaying. In the ASP.Net web.config file I let the web application...
4
7551
by: Aren Cambre | last post by:
Why does SmtpMail.Send throw an exception if the MailMessage's BodyFormat = MailFormat.Html? I've searched all over the place and cannot find a solution anywhere. I am running this on Windows XP SP2, and IIS's SMTP and WWW servers are installed. Here is the error trace: System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an...
3
1831
by: Nathan Sokalski | last post by:
I have an ASP.NET page that sends a Mail.MailMessage to several email addresses (all mine). However, one of the addresses, the one ending in @verizon.net, does not seem to be recieving the message even though the other addresses are. I know the spelling is correct because I have tried sending messages from my other accounts to this address and have recieved them successfully. I also do not know of any junkmail filter that would delete the...
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8774
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9447
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9307
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.