473,386 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

using System.Web.Mail ?

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 = fe**@yahoo.com
Dim a As System.Web.Mail.SmtpMail
a.Send(mo)

Line 8: mo.To = "fe**@yahoo.co.uk"
Line 9: Dim a As System.Web.Mail.SmtpMail
Line 10: a.Send(mo)
Line 11:
Line 12: %>Thanks in advance
Jul 31 '07 #1
8 3058
<femiwrote in message news:u9**************@TK2MSFTNGP02.phx.gbl...
I received an unhandles exception in my email form as follows
Sigh - and what does the unhandled exception say...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net
Jul 31 '07 #2
Also, set your "from" property.

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:O6****************@TK2MSFTNGP03.phx.gbl...
<femiwrote in message news:u9**************@TK2MSFTNGP02.phx.gbl...
>I received an unhandles exception in my email form as follows

Sigh - and what does the unhandled exception say...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 31 '07 #3
The server rejected one or more recipient addresses. The server response
was: 550 5.7.1 Unable to relay for fe**@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 = te**@yahoo.co.uk
objCDONTSMail.To = fe**@yahoo.co.uk
objCDONTSMail.subject = "ghghghg"
objCDONTSMail.Body = "saassasa"
objCDONTSMail.Send

This works, so why the aspx scripts is unable to relay?
Jul 31 '07 #4
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.

<femiwrote in message news:OK**************@TK2MSFTNGP04.phx.gbl...
The server rejected one or more recipient addresses. The server response
was: 550 5.7.1 Unable to relay for fe**@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 = te**@yahoo.co.uk
objCDONTSMail.To = fe**@yahoo.co.uk
objCDONTSMail.subject = "ghghghg"
objCDONTSMail.Body = "saassasa"
objCDONTSMail.Send

This works, so why the aspx scripts is unable to relay?


Jul 31 '07 #5
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
Jul 31 '07 #6

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.


<femiwrote in message news:u9**************@TK2MSFTNGP02.phx.gbl...
>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 = fe**@yahoo.com
Dim a As System.Web.Mail.SmtpMail
a.Send(mo)

Line 8: mo.To = "fe**@yahoo.co.uk"
Line 9: Dim a As System.Web.Mail.SmtpMail
Line 10: a.Send(mo)
Line 11:
Line 12: %>Thanks in advance


Jul 31 '07 #7
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/
======================================
<femiwrote in message news:Oa**************@TK2MSFTNGP04.phx.gbl...
>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


Jul 31 '07 #8
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.
Aug 1 '07 #9

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

Similar topics

1
by: Trond A. S. Andersen | last post by:
Hi all, I'm working on a project in which i need to send mail attachments in the form of Excel documents from a .NET C# application. I've written a class which creates the Excel document using...
5
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. ...
1
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
2
by: Ryan | last post by:
Hi, I receive an access denied error (see below) when attempting to send an email with BodyFormat=MailFormat.Html from an asp.net page. Exactly the same code works fine in a console...
1
by: theWizard1 | last post by:
The following sends my email, but the attachment is empty. The attachment should contain the data that is in the string that was created from the xmlReader. I have a stored procedure written...
2
by: Brad | last post by:
I have a web .Net app which sends emails with attachments. After the email is sent I clean up aftermyself and delete the attachments from disk. In upgrading to .Net 2 I changed the email logic...
1
by: Prasanta | last post by:
Hello, Please cnay one can tell me how to read mail as formatted.... i have made some code using that able to read but not able to serialize..... so am i need to parse the HTML, or is there any...
1
by: Prasanta | last post by:
Hello, How to read a mail from the mail server as formatted. I am able to read the mail as row HTML, is there any class, or something method using that i can easily get the all info of that...
4
Frinavale
by: Frinavale | last post by:
Introduction Many .NET applications will require an email be sent out for various reasons. This article will give a quick examples on how to send an email using VB.NET. The examples given can...
7
by: Rob Dob | last post by:
The following code is giving me a timeout problem., no matter what I do I can't send a piece of mail using .net2.0 System.Net.Mail.SmtpClient via port 465 and using ssl, if however I try using...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...

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.