Re: This mail sending code snippet does not work
- From: "Robert Dufour" <bdufour@xxxxxxxxxx>
- Date: Sun, 5 Nov 2006 11:11:37 -0500
I also tested to use localhost using system.web.mail instead of the new
system.net.mail
I get an exception : the transport could not connect to the host when using
localhost as the smtp server. When using my mail server outside of my lan
where I am normally hosted(mail.mycompany.com) the message goes through.
There seems to be something wrong with the localhost smtp server but I can't
figure out what.
This is the code snippet I used for that test.
Dim mail As New System.Web.Mail.MailMessage()
mail.To = "bdufour@xxxxxxxxxx"
mail.From = "bdufour@xxxxxxxxxx"
mail.Subject = "this is a test email."
mail.Body = "this is my test email body"
SmtpMail.SmtpServer = "mail.mycompany.com" 'This works OK but localhost does
not
Try
SmtpMail.Send(mail)
Catch ex As Exception
MsgBox(ex.Message)
End Try
Thanks for your help.
Bob
"Cor Ligthert [MVP]" <notmyfirstname@xxxxxxxxx> wrote in message
news:ujn7MmOAHHA.1224@xxxxxxxxxxxxxxxxxxxxxxx
Robert,
Normaly you get tons of links to this website, therefore I gave you my
first thought the problem was.
http://www.systemwebmail.com/
I hope this helps,
Cor
"Robert Dufour" <bdufour@xxxxxxxxxx> schreef in bericht
news:uFjuayNAHHA.3380@xxxxxxxxxxxxxxxxxxxxxxx
Hi Cor
It was already set.
I'm getting back error Mailbox unavailable. The server response was:
5.7.1
Unable to relay for myname@xxxxxxxxxxxx
The smtp server is localhost.
The SMTP service is running on the local machine.
I was working the local machine where the app was residing via Radmin
from another machine on the LAN and I think maybe this is a security
issue, where I have to specify an SMTP server name, username and
password, but I can't find any info on how to code this.
Regards,
Bob
"Cor Ligthert [MVP]" <notmyfirstname@xxxxxxxxx> wrote in message
news:eugKNtKAHHA.1196@xxxxxxxxxxxxxxxxxxxxxxx
Robert,
First of all do you need to set IIS as SMTP server, that is not
standard, you can use the Microsoft tab in the add programs config for
that.
Cor
"Robert Dufour" <bdufour@xxxxxxxxxx> schreef in bericht
news:OcGqlgEAHHA.1196@xxxxxxxxxxxxxxxxxxxxxxx
Dim message As New MailMessage("mymail@xxxxxxxxxxxx",
"mymail@xxxxxxxxxxxx", "Test", "Test")
Dim emailClient As New SmtpClient("localhost")
emailClient.Send(message)
The IIS server is running on the local machine.
What am I missing to make this work reliably?
Thanks for any help
Bob
.
- Follow-Ups:
- Re: This mail sending code snippet does not work
- From: Cor Ligthert [MVP]
- Re: This mail sending code snippet does not work
- References:
- This mail sending code snippet does not work
- From: Robert Dufour
- Re: This mail sending code snippet does not work
- From: Cor Ligthert [MVP]
- Re: This mail sending code snippet does not work
- From: Robert Dufour
- Re: This mail sending code snippet does not work
- From: Cor Ligthert [MVP]
- This mail sending code snippet does not work
- Prev by Date: Re: Application.EnableVisualStyles() still required in version 2.0
- Next by Date: Re: [Regular Expression] (aaa AND bbb) OR (ccc AND ddd)
- Previous by thread: Re: This mail sending code snippet does not work
- Next by thread: Re: This mail sending code snippet does not work
- Index(es):
Relevant Pages
|