We help IT Professionals succeed at work.

How do I nominate sender email in following code

Rob4077
Rob4077 asked
on
231 Views
Last Modified: 2014-09-01
I am using the following partial code to reply to some emails I receive. What I want to do is have the sender set to "noreply@mydomain.com". Is that possible?

    Dim olkMsg As Outlook.MailItem
    Dim olkRpl As Outlook.MailItem
   
    Set olkMsg = Application.ActiveExplorer.Selection(1)
    Set olkRpl = olkMsg.Reply
   
    With olkRpl
        Select Case olkRpl.BodyFormat
            Case olFormatHTML
                olkRpl.HTMLBody = REPLY_HTML & olkRpl.HTMLBody
            Case Else
                olkRpl.Body = REPLY_TEXT & olkRpl.Body
        End Select
        olkRpl.Attachments.Add sAttach
       
        olkRpl.Send
'        olkMsg.Move Session.GetDefaultFolder(olFolderInbox).Folders("Deleted Items")
        olkMsg.Delete
    End With
       
    Set olkMsg = Nothing
    Set olkRpl = Nothing
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks for your answer. Exactly what I wanted.

Author

Commented:
Just tried the second option and realised that it still has me as the sender and if I reply to the reply it will come to me. Is there a way of having it look like its been sent from the NoReply address and if they do a Reply that reply gets addressed to the NoReply address WITHOUT me having to have created a NoReply address?
CERTIFIED EXPERT
Top Expert 2016

Commented:
Not that I know about

Author

Commented:
Ok that's fine. I've just created a noreply email address that has no space. Works the way I want. Thanks
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.