Solved

outlook property

Posted on 2003-11-20
3
437 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
Comment Utility
That depends on how you are sending the mail.
0
 

Author Comment

by:tatlady
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

728 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

10 Experts available now in Live!

Get 1:1 Help Now