Solved

outlook property

Posted on 2003-11-20
3
439 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

726 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