Solved

outlook property

Posted on 2003-11-20
3
438 Views
Last Modified: 2008-02-01
I wrote a VB program that will automatically send emails.
What property do I have to set to alter who the mail is from?
0
Comment
Question by:tatlady
3 Comments
 
LVL 28

Expert Comment

by:vinnyd79
ID: 9787623
That depends on how you are sending the mail.
0
 

Author Comment

by:tatlady
ID: 9787751
the following code sits in a subroutine that has subject, mailto, and body passed to it.

Set objOutlook = CreateObject("Outlook.Application")
  Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
  objOutlookMsg.To = Trim(mailto)
  objOutlookMsg.subject = subject
  objOutlookMsg.body = body
  objOutlookMsg.Send
0
 
LVL 9

Accepted Solution

by:
TooKoolKris earned 50 total points
ID: 9787972
objOutlookMsg.From =

You can do this from a regular script as well. Just have to make sure your SMTP service is running:

Set objEmail = CreateObject("CDO.Message")
objEmail.From = "whoever@domain.com"
objEmail.To = "whoever@mydomain.com"
objEmail.Subject = "Fresh Donuts"
objEmail.Textbody = "Tell the cops."
objEmail.Send
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…

770 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