Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Send email through a SMTP Server that requires authentication

Reply
Thread Tools

Send email through a SMTP Server that requires authentication

 
 
Rodrigo
Guest
Posts: n/a
 
      08-28-2003
I'm trying to send an email message using my SMTP server
that requires authentication. How can I do that? My code
is:
Dim email As System.Web.Mail.MailMessage = New
System.Web.Mail.MailMessage
email.From = ""
email.To = txtemail.Text
email.Subject = "We have receveid your comments"
email.BodyFormat = System.Web.Mail.MailFormat.Html
email.Body ="<html>" & _
"<head>" & _
"<title>Untitled Document</title>" & _
"</head>" & _
"<body>" & _
"<p><font color=""#0066FF"" size=""2""
face=""Arial, Helvetica, sans-serif"">Hi,</font></p>" & _
"<p><font color=""#0066FF"" size=""2""
face=""Arial, Helvetica, sans-serif"">You are welcome! " &
_
"</font></p>" & _
"<p><font color=""#0066FF"" size=""2""
face=""Arial, Helvetica, sans-serif"">Thanks,</font></p>"
& _
"<p>&nbsp;</p>" & _
"<p><font color=""#0066FF"" size=""2""
face=""Arial, Helvetica, sans-serif"">Me.</font></p>" & _
"</body>" & _
"</html>"

System.Web.Mail.SmtpMail.SmtpServer
= "smtp.mydomain.com.br"

System.Web.Mail.SmtpMail.Send(email)

Response.Redirect("cad_ok.aspx")

And I receive this error message:

System.Runtime.InteropServices.COMException: The transport
failed to connect to the server.

Thanks in advance,
Rodrigo
 
Reply With Quote
 
 
 
 
Marina
Guest
Posts: n/a
 
      08-28-2003
The native .NET classes do not support authentication when sending messages.
You will have to find/buy a 3rd party component that does.

"Rodrigo" <> wrote in message
news:0acf01c36d5e$a837f9e0$...
> I'm trying to send an email message using my SMTP server
> that requires authentication. How can I do that? My code
> is:
> Dim email As System.Web.Mail.MailMessage = New
> System.Web.Mail.MailMessage
> email.From = ""
> email.To = txtemail.Text
> email.Subject = "We have receveid your comments"
> email.BodyFormat = System.Web.Mail.MailFormat.Html
> email.Body ="<html>" & _
> "<head>" & _
> "<title>Untitled Document</title>" & _
> "</head>" & _
> "<body>" & _
> "<p><font color=""#0066FF"" size=""2""
> face=""Arial, Helvetica, sans-serif"">Hi,</font></p>" & _
> "<p><font color=""#0066FF"" size=""2""
> face=""Arial, Helvetica, sans-serif"">You are welcome! " &
> _
> "</font></p>" & _
> "<p><font color=""#0066FF"" size=""2""
> face=""Arial, Helvetica, sans-serif"">Thanks,</font></p>"
> & _
> "<p>&nbsp;</p>" & _
> "<p><font color=""#0066FF"" size=""2""
> face=""Arial, Helvetica, sans-serif"">Me.</font></p>" & _
> "</body>" & _
> "</html>"
>
> System.Web.Mail.SmtpMail.SmtpServer
> = "smtp.mydomain.com.br"
>
> System.Web.Mail.SmtpMail.Send(email)
>
> Response.Redirect("cad_ok.aspx")
>
> And I receive this error message:
>
> System.Runtime.InteropServices.COMException: The transport
> failed to connect to the server.
>
> Thanks in advance,
> Rodrigo



 
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
How to send email programmatically from a gmail email a/c when port587(smtp) is blocked ashish makani Python 5 09-20-2012 07:56 AM
python smtp gmail authentication error (sending email through gmailsmtp server) online Python 0 09-05-2009 11:59 PM
Using Email::Send::SMTP with authentication Bob Perl Misc 0 04-18-2006 02:46 PM
what's the easiest way to send email with SMTP authentication using java? networm Java 3 08-12-2004 01:24 PM
what is the simplest way to send out email with SMTP authentication networm Perl Misc 2 08-12-2004 08:43 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57