473,378 Members | 1,343 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,378 software developers and data experts.

Send email through a SMTP Server that requires authentication

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 = "me@mydomain.com.br"
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
Nov 17 '05 #1
1 2355
The native .NET classes do not support authentication when sending messages.
You will have to find/buy a 3rd party component that does.

"Rodrigo" <do*********@hotmail.com> wrote in message
news:0a****************************@phx.gbl...
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 = "me@mydomain.com.br"
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

Nov 17 '05 #2

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

Similar topics

4
by: Tom Petersen | last post by:
Ok, I'm 99.9999999999999999999% sure there haven't been any code changes, since the date stamps of the code are older than any email 'failures' The email piece quit working using the mail.send. ...
3
by: ratnesh | last post by:
hi, how can i send smtp mail from my asp.net webform. i give the smtp server name, but the server is remote and it requires authentication (login) to send mail. i dont know how to do that ...
5
by: Andreas | last post by:
I am working with three computers, my developing computer, a Web Server and a Mail Server (Exchange). I am trying to send a email from the Web Server via the Mail Server to a valid email address...
1
by: Volker Jobst | last post by:
Hi, The following code works fine as long as I don't use a smtp-server which requires authentication: Sub sendMail() Dim sfrom As String = TextBox1.Text Dim sto As String = TextBox2.Text...
2
by: Rabbit | last post by:
Dear All, I'm programming to send email with an assigned SMTP server, but this mail server only allows authorised account to send email, if I use this SMTP server, any mail class or sample code...
2
by: oyster | last post by:
I find that the existing email moudle is some hard for me to understand, especially the part of how to set the CC, BCC and attach the files. Is there any more easy one like this p-code? import...
7
by: oopsbabies | last post by:
Hello everyone, I am using Apache 1.3.33 as the web server and PHP version 4.3.10. My machine is using Windows XP 2002 professional edition which comes with a Windows firewall. I am using McAfee...
8
by: shapper | last post by:
Hello, I am trying to send an email using Asp.Net 2.0. I am getting the following error: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: No such...
7
by: John Drako | last post by:
Currently, I run postfix on my own server to send message from my site (password requests, account activation notices and other messages). I have phpMailer on the server and all the messages...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.