Link to home
Start Free TrialLog in
Avatar of hendrix500
hendrix500

asked on

Emailing from VB.NET APP

Hi everyone.

I have a problem sending emails from my vb.net program. It is fine sending to email address's on our domain, but doesn't work if I try and send to an external address e.g. hotmail account. No error is reported, the email is just never recieved.

Code is as follows:

Dim Message As New System.Web.Mail.MailMessage
With Message
    .To = "<myexternaladdress@hotmail.co.uk>"
    .From = "<myapp@mydomain.co.uk>"
     .Body = "My test mail"
     .Subject = "My subject"
End With

Dim MailServer As System.Web.Mail.SmtpMail
MailServer.SmtpServer = "555.555.555.5"   'IP of my exchange server (version 5.5 sp2)
MailServer.Send(Message)

Any help would be great

Thanks
SOLUTION
Avatar of jhance
jhance

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hendrix500
hendrix500

ASKER

Thanks for your help
Both answers were correct. I awarded slighlty in favour of emoreau because of the suggestion to install a SMTP server.

Thanks alot to both