Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

using System.Web.Mail ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
femi - 31 Jul 2007 13:29 GMT
I received an unhandles exception in my email form as follows

Dim mo As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage
mo.Body = "test"
mo.To = femi@yahoo.com
Dim a As System.Web.Mail.SmtpMail
a.Send(mo)

Line 8:  mo.To = "femi@yahoo.co.uk"
Line 9:  Dim a As System.Web.Mail.SmtpMail
Line 10: a.Send(mo)
Line 11:
Line 12: %>Thanks in advance
Mark Rae [MVP] - 31 Jul 2007 13:39 GMT
> I received an unhandles exception in my email form as follows

Sigh - and what does the unhandled exception say...?


Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

James - 31 Jul 2007 14:56 GMT
Also, set your "from" property.

>> I received an unhandles exception in my email form as follows
>
> Sigh - and what does the unhandled exception say...?
femi - 31 Jul 2007 15:18 GMT
The server rejected one or more recipient addresses. The server response
was: 550 5.7.1 Unable to relay for femi@yahoo.co.uk
this is strange, I used a similar form with cdonts and asp and
I don't get this error, it's on the same server, as follows:

Set objCDONTSMail = CreateObject("CDONTS.NewMail")
objCDONTSMail.From = test@yahoo.co.uk
objCDONTSMail.To = femi@yahoo.co.uk
objCDONTSMail.subject = "ghghghg"
objCDONTSMail.Body = "saassasa"
objCDONTSMail.Send

This works, so why the aspx scripts is unable to relay?
Aidy - 31 Jul 2007 15:47 GMT
That's an error from the SMTP server saying it can't deliver the message.
This is nothing to do with your code per se.  Are you specifying an SMTP
server to send the mail through?  It seems that server can't relay the
message on.

> The server rejected one or more recipient addresses. The server response
> was: 550 5.7.1 Unable to relay for femi@yahoo.co.uk
[quoted text clipped - 9 lines]
>
> This works, so why the aspx scripts is unable to relay?
femi - 31 Jul 2007 16:28 GMT
> This is nothing to do with your code per se.  Are you specifying an SMTP
> server to send the mail through?  It seems that server can't relay the
> message on.

I am not, but neither do I with old fashioned cdonts, so are you saying
there can be a sutuation where cdonts knows where smtp is and
aspdotnet doesn't know? I'd rather not specify this, so that it will pick
up what is appropriate without my intervention (portable script).

If not, how can I find which smtp cdonts is using, so that I can install
this info into my asp.net script.

Thanks in advance
Juan T. Llibre - 31 Jul 2007 17:19 GMT
http://www.systemwebmail.com/faq/4.3.11.aspx

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
>> This is nothing to do with your code per se.  Are you specifying an SMTP
>> server to send the mail through?  It seems that server can't relay the
[quoted text clipped - 9 lines]
>
> Thanks in advance
femi - 01 Aug 2007 14:14 GMT
Thank you, but no answers there,

My cdonts object on the same host does relay to any address

WebMail however, (on same host) doesn't replay, but now I
found that it will relay locally, i.e. back to myself.

Since cdonts does work, my logic tells me it can't be an smtp
issue.
sloan - 31 Jul 2007 16:39 GMT
Downloadable examples for 1.1 and 2.0 can be found at:

http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!138.entry

................

There are different rules depending on which smtp server you're trying to
use.

The downloadable code samples will make this more clear.

>I received an unhandles exception in my email form as follows
>
[quoted text clipped - 9 lines]
> Line 11:
> Line 12: %>Thanks in advance

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.