G
Georges BESSIS
Hi,
I found rather simple to send mail via SMTP under VB.Net.
I use the simple code (see under) which works fine if you know the SMTP
server adress.
But I want to insert it in an App used by people who dont know about such
things.
So I need a way to determine programatically which is the SMTP server to
use. Do you have any idea on how I could get that?
Second question (similar) : Can I get the default email adress so the user
(sender) does not have to enter it?
Thanks in advance.
GB
'-----------------------------------------
' Here is my current test code
' ---------------------------------------
Dim MyMail As New MailMessage
MyMail.From = New MailAddress("(e-mail address removed)")
MyMail.To.Add(New MailAddress("(e-mail address removed)"))
MyMail.Subject = "Some subject"
MyMail.Body = "Test message via SMTP"
Dim Client As New SmtpClient
Client.Host = "SMTP.domain.fr""
Client.Send(MyMail)
I found rather simple to send mail via SMTP under VB.Net.
I use the simple code (see under) which works fine if you know the SMTP
server adress.
But I want to insert it in an App used by people who dont know about such
things.
So I need a way to determine programatically which is the SMTP server to
use. Do you have any idea on how I could get that?
Second question (similar) : Can I get the default email adress so the user
(sender) does not have to enter it?
Thanks in advance.
GB
'-----------------------------------------
' Here is my current test code
' ---------------------------------------
Dim MyMail As New MailMessage
MyMail.From = New MailAddress("(e-mail address removed)")
MyMail.To.Add(New MailAddress("(e-mail address removed)"))
MyMail.Subject = "Some subject"
MyMail.Body = "Test message via SMTP"
Dim Client As New SmtpClient
Client.Host = "SMTP.domain.fr""
Client.Send(MyMail)