Solved

Send FROM using OutMail?

Posted on 2008-10-27
4
606 Views
Last Modified: 2012-08-13
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

0
Comment
Question by:m0tSiE
  • 2
  • 2
4 Comments
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 22812129
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
 

Author Comment

by:m0tSiE
ID: 22812406
Thanks emoreau,

The problem is that I am sending via an exchange server, therefore I dont have any SMTP details to add.
0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 22812863
You can use your Exchange server as your SMTP server
0
 

Author Closing Comment

by:m0tSiE
ID: 31510268
Cheers.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now