Solved

Change the reply email address of emails generated from MS-Access Database

Posted on 2006-11-26
7
326 Views
Last Modified: 2012-06-21
G'day Folks,

I'm just wondering if anyone knows how to change the reply email address of emails generated from MS-Access using either default mail client (Outlook or OE). Basically I have a a quote management system sitting on a Windows 2000 Server - about 10 users access the DB using Terminal Services, so if I want them to each send emails I have to somehow custom generate the email and tag it with the users specific reply email address, so they can receive any follow up emails from the quote.
I've had a look, but I can't seem to see much in the properties of the 'MailItem' Outlook (VBA object)... just the ReplyRecipients and SendEmailAddress, but both seem to be read only properties.
If anyone's done this before or knows a way to, please lend us a hand.

Cheers, Chyro
0
Comment
Question by:CHYRO
[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
  • 4
  • 3
7 Comments
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18016267
If the e-mail is sent by a specific rep, the e-mail is delivered to the recipient with that rep's e-mail address correct? Wouldn't that then be the reply to address? Are you able to do this already? I'm not aware of a specific reply to address in the automation feature. Is the following what you're using?

        Set olkApp = New Outlook.Application
        Set olkNameSpace = olkApp.GetNamespace("MAPI")
        Set objMailItem = olkApp.CreateItem(olMailItem)
            With objMailItem
                .To = strTo
                .CC = "Enter E-Mail Address Here"
                .BCC = "Enter E-Mail Address Here"
                .Subject = EmailSubject
                .Body = Emailbody
                .Attachments.Add Attachment1
                    If FileExist(Attachment2) Then
                        .Attachments.Add Attachment2
                    End If
                .Display 'change this to "send" if you don't want to preview the e-mail
            End With
0
 

Author Comment

by:CHYRO
ID: 18017626
Hi jefftwilley,

Yes the code I use is similar to what you have posted. but because each user is using the same credentials/windows profile to login into terminal services, they are using the same configuration in the email client, i.e only one 'sent from'/'reply email address'. So I therefore need to change the 'reply email address' of the generated email on the fly to a value associated with the specific rep that is logged into the db (The db has its own log on that can be used to identify which rep is logged on)... I hope this explains it a bit better.
Bascially I need to somehow have multiple sales reps sending emails that look to come from them individually when they are all using the same windows account through TS.

Cheers, Chyro

p.s. Perhaps it's possible to set up multiple identies in Outlook Express, and then use a specific identity to send emails dependant on who is logged in ?
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18019253
It's possible...sure. Not sure how the outlook model handles that as of yet....but. Here's a CDO method that may serve your purpose.

http://www.experts-exchange.com/Databases/MS_Access/Q_21136836.html?query=change+the+sender+on+email+from+access&topics=39


Another option is to use a handler (API) that launches the default e-mail directly and allows you to pass in a "From" arguement
http://www.experts-exchange.com/Databases/MS_Access/Q_21417170.html

I'm still researching the outlook method. I'd kind of like to know myself. Hang in there.
J
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 34

Expert Comment

by:jefftwilley
ID: 18019293
an alternative also

You can use the constants olTo, olCC, and olBCC to set the To, Cc, and Bbc address fields of the MailItem. However, olOriginator does not set the From field.

To set the From field, use the SentOnBehalfOfName property of the Item object. The following example demonstrates the use of the SentOnBehalfOfName property: Sub TestSentOnBehalfOfName()

   Dim myOlApp as Outlook.Application
   Dim myItem as Outlook.MailItem

   ' Create an Outlook application object
   Set myOlApp = New Outlook.Application

   ' Creates a new MailItem form
   Set myItem = myOlApp.CreateItem(olMailItem)

   ' Set the "From" field
   myItem.SentOnBehalfOfName = "Jon Grande"

   ' Display the item
   myItem.Display

End Sub

0
 
LVL 34

Accepted Solution

by:
jefftwilley earned 125 total points
ID: 18019297
That last method will require that you set permissions on each user's account to allow the term e-mail source to send on behalf of. Otherwise, should work.
J
0
 

Author Comment

by:CHYRO
ID: 18035058
Thanks jefftwilley,

Give me a couple of days, and the customer is remot from here, and I will test you method, and then get back to you...

Cheers, Chyro
0
 

Author Comment

by:CHYRO
ID: 18346236
Sorry that took a few more than a couple of days and I haven't actually even seen whether it will work, but I will give you the benefit fo the doubt and award the points - Thanks very much for you time and effort Jeff - give my regards to Brian if you know him
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

688 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