Link to home
Start Free TrialLog in
Avatar of m0tSiE
m0tSiE

asked on

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

Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

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
Avatar of m0tSiE
m0tSiE

ASKER

Thanks emoreau,

The problem is that I am sending via an exchange server, therefore I dont have any SMTP details to add.
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of m0tSiE

ASKER

Cheers.