?
Solved

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

Posted on 2006-11-26
7
Medium Priority
?
329 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 375 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

777 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