finding out a users default email?

H

Howard

I'm writing a small vb application for use in a school where we all have
radio networked laptops and use internal email with outlook.

The idea is that a button on a form sends an 'emergency' email to one
special email address.

I can make it work with the code shown below but I need to hard code my own
address as the sender.
Is there a way to extract the email address of the person who is logged on
so that I can automatically send it from them?

Howard


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim mail As New MailMessage()

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

mail.From = "(e-mail address removed)"

mail.Subject = "this is a test email."

mail.Body = "this is my test email body"

SmtpMail.SmtpServer = "smtp.mydomain.co.uk" 'your real server goes here

SmtpMail.Send(mail)

End Sub
 

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

Top