Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 17th, 2008, 07:27 AM
Friend of Wrox
Points: 912, Level: 11
Points: 912, Level: 11 Points: 912, Level: 11 Points: 912, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2005
Location: Dublin, , Ireland.
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Default Different From Field when sending e-mails

Hi All
I send e-mails thru access using the following code
DoCmd.SendObject acSendReport, "RPTTT1", acFormatRTF, "Brendan.Bartley@anpost.com", "", "", " Call Logging " & CallType, " Call Logging logged by " & LoggedBy, True
I have a second e-mail address that I want to populate the from field with when I send each e-mail. Is this possible to insert a different e-mail address into the from field
Thanks

Brendan Bartley
__________________
Brendan Bartley
  #2 (permalink)  
Old June 17th, 2008, 02:23 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Do you mean send it with a different FROM field, or with TWO from addresses, like: "Brendan.Bartley@anpost.com;mmcdonal@aoc.gov"

I don't think you can concatenate from fields, but you can change the from field in your string by placing the field in a variable, and then changing the value of the variable for whatever reason, as long as your email system will accept emails from the sender. For example:

Dim sFrom As String

If (condition is met) Then
   sFrom = "Brendan.Bartley@anpost.com"
Else
   sFrom = "mmcdonal@anpost.com"
End If


DoCmd.SendObject acSendReport, "RPTTT1", acFormatRTF, sFrom, "", "", " Call Logging " & CallType, " Call Logging logged by " & LoggedBy, True

Is that what you are getting at?


mmcdonal

Look it up at: http://wrox.books24x7.com


Similar Threads
Thread Thread Starter Forum Replies Last Post
sending e-mails How To?? saudyonline General .NET 13 November 17th, 2006 01:00 AM
sending mails arabuafef Classic ASP Basics 0 July 18th, 2006 06:29 AM
Sending mails. rupen Javascript How-To 1 October 25th, 2005 07:22 AM
Sending e-mails using C# lily611 General .NET 3 June 30th, 2004 05:46 AM
Sending mails rajeshnerenki Pro VB 6 4 September 25th, 2003 03:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.