Solved

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

Posted on 2006-11-26
7
318 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
  • 4
  • 3
7 Comments
 
LVL 34

Expert Comment

by:jefftwilley
Comment Utility
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
Comment Utility
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
Comment Utility
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 34

Expert Comment

by:jefftwilley
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now