System.Net.Mail

F

Fetty

I need to send the email with an email address that is not in my
domain, but it will not do that. Can this be done
 
M

Mark Fitzpatrick

How are you sending it? Can you illustrate a code snippet so we can get an
idea of what could be blocking you from sending the email? From my
experience the mail namespace doesn't really care about those details, but
sometimes the host smtp server rejects the message instead due to relaying
issues.
 
F

Fetty

'create the mail message
Dim mail As New MailMessage()

'set the addresses
mail.From = New MailAddress("(e-mail address removed)")

mail.To.Add("(e-mail address removed)")

'set the content
mail.Subject = "This is an email"
mail.Body = "this is the body content of the email."

'send the message
Dim smtp As New SmtpClient("xx.xx.xx.xx")

'to authenticate we set the username and password properites on
the SmtpClient
smtp.Credentials = New
System.Net.NetworkCredential("(e-mail address removed)", "xxxxx")
smtp.Send(mail)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top