sending email, but with different reply to address

R

red6000

Hi I have the code below from
(http://word.mvps.org/FAQs/InterDev/SendMail.htm)

It works great, but I don't want the recipient to know the email address of
the sender (and thus be able to reply to the mail).

Is it possible to amend the code to put a dummy email address of for
replying (ie (e-mail address removed))

Thanks

Sub SendDocumentAsAttachment()

Dim bStarted As Boolean
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem

On Error Resume Next

If Len(ActiveDocument.Path) = 0 Then
MsgBox "Document needs to be saved first"
Exit Sub
End If

Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If

Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
.To = TextBox1.Value
.Subject = TextBox2.Value
.Attachments.Add Source:=ActiveDocument.FullName, Type:=olByValue, _
DisplayName:="Document as attachment"
.Body = "This mail has been sent from an unmanned email account,
please do not reply"
.Send
End With

If bStarted Then
oOutlookApp.Quit
End If

Set oItem = Nothing
Set oOutlookApp = Nothing

End Sub
 
R

red6000

Okay,

I've added:

..ReplyRecipients.Add ("The email address that this mail came from is an
un-manned mailbox and will be automatically (e-mail address removed)")

and this does change the reply address, but the senders address is still
visible in the recieved email.

I've tried .senderemailadress, but this is a read only property.

Is it possible to hide the senders address?

Thanks.
 
D

Doug Robbins - Word MVP

If I were to receive an email of the type that you are trying to send, it
would get delete immediately.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
R

red6000

Thanks for the help?

The email is going to companies that we have contracts with so they will
recognise and trust the domain. What we want is any incoming mail to go to
a central mailbox and not have our partners replying to the individuals
mailbox that the mail came from.

Clearly the text below is not what i will really say in the mails, but I'm
not going to put the genuine mail address in the example code here as I'll
just end up getting spammed.

If you google my posts over the past few months, hopefully it is clear that
I'm not trying to come up with a spamming scam.

Is there a way to choose which account in Outlook the mail is sent from so
that I can choose the central mailbox account or use the code below and hide
the individuals mail address?
 
R

red6000

Ahh,

I need the sentnbehalfofname property and set up the central mailbox as a
contact.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top