Solved

Hardcode the reply address in an e-mail generated by MS Access.

Posted on 2006-11-07
4
535 Views
Last Modified: 2008-02-01
Hi All

I have a DB that is used by a few people that generates and e-mail and sends it to the one e-mail address. When that recipient replies, the reply will go to whoever sent the e-mail. Is there any way to hardcode one e-mail address that will always receive the replies?

An abridged version of my code is as follows;

Private Sub EmailFault_Click()

 'send e-mail
        Dim objOutlook As Outlook.Application
        Dim objOutlookMsg As Outlook.MailItem
        Dim objOutlookRecip As Outlook.Recipient
        Dim objOutlookAttach As Outlook.Attachment

        'create the Outlook session
        Set objOutlook = CreateObject("Outlook.Application")

        'create the message
        Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
   
        With objOutlookMsg
            'add the recipients to the message
   
            Set objOutlookRecip = .Recipients.Add("xxx@xx.com")  'send to the user
            objOutlookRecip.Type = olTo
         
            'set the subject and body of the message

            Dim Message As String
            Dim subject_line As String
   
            subject_line = "From xx"
             
            Message = "xx.         No:" & "   " & fault_number.Value & vbCrLf & _
                      vbCrLf & _
                      vbCrLf & _
                      vbCrLf & _
                      "xx:" & vbCrLf & _
                      vbCrLf & _
                      junction_reference.Value & "          " & junction_address.Value & vbCrLf & _
                      vbCrLf & _
                      vbCrLf & _
                      vbCrLf & _
                      "xx;" & vbCrLf & _
                      vbCrLf & _
                      fault_details_1.Value & " " & fault_details_2.Value & vbCrLf & _
                      vbCrLf & _
                      vbCrLf & _
                      vbCrLf & _
                      "Reported by;" & "         " & reported_by_whom & "           " & date_reported & "     Fault reported at:   " & time_reported & vbCrLf & _
                      vbCrLf & _
                      vbCrLf & _
                      "xx." & vbCrLf

            .subject = subject_line
            .Body = Message

             
            '.Send
            .Display 'display the e-mail before sending
   
        End With

        Set objOutlookMsg = Nothing
        Set objOutlook = Nothing
       
End Sub

Is the ReplyRecipients Property relevant to this?

Thanks
Dakan
0
Comment
Question by:abaines
  • 3
4 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 125 total points
ID: 17888322
Yes. Give this addition a try:

        With objOutlookMsg
            'Add reply recipients
            .ReplyRecipients.Add   "addr@email.com"
            'add the recipients to the message
                         etc...
0
 
LVL 61

Expert Comment

by:mbizup
ID: 17888340
0
 

Author Comment

by:abaines
ID: 17889627
Thanks mbizup.

That did the trick.

Dakan
0
 
LVL 61

Expert Comment

by:mbizup
ID: 17889647
Glad to help :-)
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
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…
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…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

705 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

18 Experts available now in Live!

Get 1:1 Help Now