View Single Post
Old Jul 9th, 2007, 12:35 PM   #1
mattireland
Hobbyist Programmer
 
mattireland's Avatar
 
Join Date: Jul 2007
Location: Wales, United Kingdom
Posts: 203
Rep Power: 2 mattireland is on a distinguished road
Send a message via MSN to mattireland Send a message via Skype™ to mattireland
Angry More Mail Problems!!!

Right OK, I want to create this mailing feature of one of my programs. So you were very helpful and gave me the namespace I needed to research. I initially tried it and had problems with the relay server and now I'm trying to fix these:

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

'set the addresses
mail.From = New MailAddress(“matt@mattireland.co.uk”, Matt Ireland)
mail.To.Add(“eg@example.net”, “Mr Example”)

'set the content
mail.Subject = "Testing"
mail.Body = "Testing email"

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

'to authenticate we set the username and password properites on the SmtpClient
‘what do I do with this bit???
smtp.Credentials = New NetworkCredential("username", "password")
smtp.Send(mail)
End Sub 'Authenticate

I'm not sure what to do with the bit that I've marked. Please could someone help? I'm still a real noob in this area so haven't quite grasped the relay server bit yet. Goodness: and I thought that DX was the hardest VB got!
__________________
Matt Ireland
http://www.mattireland.org
matt@mattireland.co.uk
mattireland is offline   Reply With Quote