Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lock the Reply To Address

Status
Not open for further replies.

MikeAuz1979

Programmer
Aug 28, 2006
80
AU
Hi,

Using Access 2000 and Outlook 2003 I'm automatically sending emails using the below code which sets the reply to address if the recipient replies to the email.

This works fine but what I'm finding is some unhelpful recipients are replying to the email and replacing the correct reply address with my address. (As I am the sender)

Any idea if I can lock down the reply to so that when the recipient hits reply they can't change the address?

Thanks for any help
Mike

---Code Start (Assembled from various help sources)---
Sub SendMail(Recip, ccRecip, ReplyTo, Freq, Con As Boolean, CustName, SaveFile)
'- Requires free program Advanced Security for Outlook installed on the reporting PC.
'- Available at '- First time you run this, just select 'Allow' and tick 'Always perform this action'
Dim subject, bodytext As String
Dim objOutlook, olMailItem, objEMail As Variant

subject = Freq & " Consumption Information for " & CustName
If Con = True Then
bodytext = "Please find attached your consumption information." & vbCrLf & "If you have any queries please simply reply to this email."
Else
bodytext = "Please note you have no recorded consumption for this period." & vbCrLf & "If you have any queries please simply reply to this email."
End If

Set objOutlook = CreateObject("outlook.application")
Set objEMail = objOutlook.CreateItem(olMailItem)

With objEMail
.To = Recip
.cc = ccRecip
.subject = subject
.body = bodytext
.ReplyRecipientNames = ReplyTo
If Not IsEmpty(SaveFile) Then
.Attachments.Add SaveFile
End If
.Save
.send
End With

Set objOutlook = Nothing
Set objEMail = Nothing

End Sub

---Code End---
 
what about replacing this:
.ReplyRecipientNames = ReplyTo
with this ?
.ReplyRecipients.Add ReplyTo

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top