Send FROM using OutMail?

Hi,

I am currently using the attached code to send an email via outlook when a button is clciked, however it doesnt recognise the .From field.

Is there a way around this so I can send from a certain mailbox?

Thanks,

Paul.
With OutMail
            .From = "me@email.com"
            .To = DestinationEmail
            .CC = ""
            .BCC = "email@email.com"
            .Subject = "Test Message"
            .Body = strbody
            .htmlbody = strbody
            .send()
 
        End With

Open in new window

m0tSiEAsked:
Who is Participating?
 
Éric MoreauSenior .Net ConsultantCommented:
You can use your Exchange server as your SMTP server
0
 
Éric MoreauSenior .Net ConsultantCommented:
it is better not to use the Outlook object for many reasons (like you will get a security dialog on the Send method).

have a look at http://www.emoreau.com/Entries/Articles/2007/09/Using-SystemNetMail.aspx to be introduced to the System.Net.Mail namespace
0
 
m0tSiEAuthor Commented:
Thanks emoreau,

The problem is that I am sending via an exchange server, therefore I dont have any SMTP details to add.
0
 
m0tSiEAuthor Commented:
Cheers.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.