Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2006-11-26
7
Medium Priority
?
336 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

618 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