Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SendObject and Return Replies

Status
Not open for further replies.

SDS100UK

MIS
Jul 15, 2001
185
GB
Hi,

I am able to get access (XP) to send emails aplenty, but what would really really be good is if when the recipient receives the email and replies it replies to a different address (ie a group) rather than the individual who sent it.

I want replies to go to a group as the individual that sent the mail may not be in work to receive the rerurn reply.

Is it possible to do what I seek??

MAny thank in advance


Steven
 
Steven

You can use the following to actually send the email from a different address (Given that you have access to in the exchange server)

Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

With objEmail
.To = [myEmail]
.Subject = "SIMplus " & Company & " Upgrade File " & Format(Now(), "yymmdd")
.Attachments.Add "I:\Penske Project\Exports\" & Company & Format(Now(), "yymmdd") & ".xls"
.sentonbehalfofname = "OtherEmailAddress"
.Send
End With

Set objEmail = Nothing
 
Thats fantastic Mike,

But where do I out it?On the click of the button that would normally email? Also is the only think i need to change th e "OtherEmailAddress"

Many thanks again


Steven
 
Steven,

The things you would need to change are:
(Before the With objEMail line)
MyEmail = "The email address you want to send to"
(After the with objEmail Line)
.subject = "Whatever you want you subject to be in quotes"
.Attachments.Add (Can Leave this out if you dont want any)
.sentonbehalfofname = "Email address you want to send from"

Also as you can see above you can specify variables first and then inlcude them in the .Something lines (Eg is variable 'company'in the .subject line)

But this code actually just sends the email by itself (I beleive later versions of office will prompt with an 'Are you sure' in order to prevent spamming) if you want this to present the email to the user to send instead just change the .send to .display

Hope this helps
Mike


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top