Solved

outlook property

Posted on 2003-11-20
3
440 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

734 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