Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Trouble sending email with ASP.NET 2.0

Reply
Thread Tools

Trouble sending email with ASP.NET 2.0

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      01-05-2007
I have an ASP.NET 2.0 application that is supposed to send an email after a
certain form is submitted. When it tries to send the email, I receive the
following error:


Transaction failed. The server response was: http://www.velocityreviews.com/forums/(E-Mail Removed):
Recipient address rejected: Access denied


(in the error message, the part with the email address was displayed as
<myemailaddress>, but you will probably see a link because our news viewers
think they know what we want). I know that the address is correct, so what
is it that the server didn't like about it? Is it saying I don't have
permission to use the SMTP server (I was pretty sure I was, but this is the
first time I am sending email from this server)? Is there something wrong
with my code? Any help would be appreciated. Thanks.
--
Nathan Sokalski
(E-Mail Removed)
http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
Morten Snedker
Guest
Posts: n/a
 
      01-05-2007
On Fri, 5 Jan 2007 03:55:44 -0500, "Nathan Sokalski"
<(E-Mail Removed)> wrote:

> Is there something wrong
>with my code? Any help would be appreciated. Thanks.


You didn't provide your code, so it is hard to tell.

However, this works for me:

Try
Dim mail As New Mail.MailMessage()

mail.From = New Mail.MailAddress("(E-Mail Removed)",
"Subject")
mail.To.Add("(E-Mail Removed)")

mail.Subject = "Subject"
mail.Body = "Body"

Dim smtp As New Mail.SmtpClient("mail.planprojekt.dk")
smtp.Credentials = New
NetworkCredential("(E-Mail Removed)", "password")
smtp.Send(mail)

bEmailSent = True
Catch ex As Exception
Exit Sub
End Try


/Snedker
 
Reply With Quote
 
 
 
 
Nathan Sokalski
Guest
Posts: n/a
 
      01-05-2007
The code I am using is as follows:


Private Sub SendEmailNotification()
Dim confsender As New
SmtpClient(System.Configuration.ConfigurationManag er.AppSettings("smtpserver"))
Dim confirmation As New MailMessage()
confirmation.IsBodyHtml = False
confirmation.From = New MailAddress("(E-Mail Removed)")
confirmation.To.Add("(E-Mail Removed)")
confirmation.Subject = "My Subject"
confirmation.Body = "My Body"

confsender.Send(confirmation)
End Sub


Thanks.
--
Nathan Sokalski
(E-Mail Removed)
http://www.nathansokalski.com/
"Morten Snedker" <morten_spammenot_ATdbconsult.dk> wrote in message
news:(E-Mail Removed)...
> On Fri, 5 Jan 2007 03:55:44 -0500, "Nathan Sokalski"
> <(E-Mail Removed)> wrote:
>
>> Is there something wrong
>>with my code? Any help would be appreciated. Thanks.

>
> You didn't provide your code, so it is hard to tell.
>
> However, this works for me:
>
> Try
> Dim mail As New Mail.MailMessage()
>
> mail.From = New Mail.MailAddress("(E-Mail Removed)",
> "Subject")
> mail.To.Add("(E-Mail Removed)")
>
> mail.Subject = "Subject"
> mail.Body = "Body"
>
> Dim smtp As New Mail.SmtpClient("mail.planprojekt.dk")
> smtp.Credentials = New
> NetworkCredential("(E-Mail Removed)", "password")
> smtp.Send(mail)
>
> bEmailSent = True
> Catch ex As Exception
> Exit Sub
> End Try
>
>
> /Snedker



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem sending mail: Sending the email to the following server failed Luke Java 2 03-15-2007 10:54 AM
Trouble sending an email with Mailer module laredotornado@zipmail.com Perl Misc 2 01-31-2006 10:11 PM
Having trouble sending/receiving Email Edw. Peach Computer Security 1 01-16-2006 12:46 PM
Trouble w sending email =?Utf-8?B?S2VubmV0aCBQ?= ASP .Net 1 08-27-2005 12:10 PM
Trouble sending email out via xtra Starkey NZ Computing 1 07-15-2005 03:43 AM



Advertisments