How can I modify an email address when I reply to it? [Outlook 2003]

Status
Not open for further replies.
W

WayBehindSchedule



We are using an email to SMS service that allows us to send an SMS to a mobile phone number when concatenated with a certain string. We get the replies to these messages via email, but the replies come in a different format (i.e. they don't have the same sending string as the original message). Is there a way I can set up a macro that will remove the reply address, take the display name (this is the mobile phone number) and concatenate a string onto the end of it?

Thanks in advance.
 
J

Jennifer Zhan



Hi,

Try this VB script:

Dim OApp As New Outlook.Application
Dim Mymail As Outlook.MailItem
Const olmailitem = 0
Set Mymail = OApp.CreateItem(olmailitem)
Mymail.To = txtEmailTo
Mymail.BCC = txtEmailBccTo
Mymail.Subject = txtSubject
If Myformat = 1 Then
Mymail.HTMLBody = txtTextBody ' send as HTML
Else
Mymail.Body = txtTextBody ' send as TEXT
End If
' .ReplyRecipients is reported as being readonly! This is an error you can write to it
Mymail.ReplyRecipients.Add txtEmailFrom
Mymail.Send
Set OApp = Nothing
Set Mymail = Nothing
Hope this helps!
BTW This will only change the reply email address not who it was sent from.
 
W

WayBehindSchedule

Many thanks, Jennifer - I'm on the road for a couple of days and will try it out and report the outcome when I get back.
 
W

WayBehindSchedule



Sorry - I'm not sure I explained myself well enough, or I'm not understanding how the code above is supposed to work. I'll have another try.

I send an email with the following format (all phone numbers and email addresses will be fake):

0400123456.p+sometext@smsexample.com

This sends the text in the subject of the email to the phone number 0400123456 as an SMS message.

Then, if the person responds to the SMS, I get the message in my email. The from address will be 0400123456@smsexample.com - it will be missing the .p+sometext element that is required to send the email to the phone as an SMS. Therefore, if I reply to the response, it won't be sent to the phone. I'm looking for a way to put back the .p+sometext so that I can reply to a reply without manually altering the email address.

Does the code above do that? I couldn't get it to work when I tried it.

Thanks in advance.
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
A Auto modify an email used in 'Server reply using'. Using Outlook 1
U How modify attachment in an email Using Outlook 5
R Outlook 2010 Modify Style "Do not check spelling or grammar" not saving Outlook VBA and Custom Forms 0
O modify vba to run it as script rule Outlook VBA and Custom Forms 8
Justo Horrillo It's possible to modify the behaviour of the conversation option? Using Outlook 2
S Modify account template? BCM (Business Contact Manager) 0
R Can't modify Outlook view font with IE anymore (even though IE still affects print font) Using Outlook 5
smokiibear How to modify Today Page to Include tasks from other task folders Using Outlook 1
S Modify recurring outlook invites based on form entry Using Outlook 0
S VBA to modify appointment item in additional Exchange account doesn't work Using Outlook 0
C How To Open Outlook Attachment in Excel, Modify some Data, then Re-Save It Using Outlook 3
A Possible to modify people preview window? Using Outlook 1
R How to modify Outlook Select Rooms form columns Using Outlook 1
G Modify Subject line of incoming mail where I am in Cc line Using Outlook 1
B Outlook 2007, must modify incomming e-mail addresses to reply Using Outlook 3
C modify user password programmatically Exchange Server Administration 9
H Use group policy to block access to modify account settings outlook/exchange 2010. Using Outlook 1
P Will 'ldap modify' command work on some Active Directory fields? Using Outlook 2
S Unable to create or modify mailboxes in Exchange 2010 after modifying AD with ADSIEDIT Exchange Server Administration 4
L not able to access signatures to modify, add, or edit. Using Outlook 1
C unable to modify tags for categories in outlook 2010 Using Outlook 1
T Is there a way to bulk modify the alias field in a Exchange 2010 enviornment? Exchange Server Administration 2
K Adminstrator unable to modify any of the settings in Exchange 2010 - insufficient access rights Exchange Server Administration 4
J Rights to modify all distribution lists Exchange Server Administration 3
S I noticed most of my rules are not able to be edited or deleted - the option to do so are 'faded' out. A few rules are OK to modify etc. See Using Outlook 3
A Changed the 'Modify Configuration DOmain Controller' on Exchange 2010 casnhub server Exchange Server Administration 2
A Changed the 'Modify Configuration DOmain Controller' on Exchange 2010 casnhub server Exchange Server Administration 5
B Error while creating/saving a new appointment in Outlook web access 2003 'You don't have permission to modify this item'. Using Outlook 1
Z Unable to configure an IPv4 address because IPv4 is not available.Attempt to modify the IP addresses Exchange Server Administration 4
N modify New mesage SEND button Outlook VBA and Custom Forms 1
R Custom Archive code -- modify my code! Outlook VBA and Custom Forms 3
C How do I grab a field property (like .value) so I can modify it via OL code? Outlook VBA and Custom Forms 4
A Script to either modify "from" address or prevent a reply being se Outlook VBA and Custom Forms 2
B Can't modify PR_CLIENT_SUBMIT_TIME? Outlook VBA and Custom Forms 1
D Sending email from Office 365 alias in Outlook Using Outlook 4
S Macro or plug-in to see if specific person was included in this email Outlook VBA and Custom Forms 2
S Body text of Email from invite date/time Outlook VBA and Custom Forms 8
R Outlook 2010 How do you export 2 email Accounts' 2010 Inbox Files to new computer (2019)? Using Outlook 1
R Auto display of new email does not work on non-default account Outlook VBA and Custom Forms 0
J Automatically forward email and apply template Outlook VBA and Custom Forms 0
L Outlook saved email templates Using Outlook 1
B VBA to convert email to task, insert text of email in task notes, and attach copy of original email Outlook VBA and Custom Forms 4
T How can you include Junk Email in Search Results like you can include Deleted Items? Using Outlook 3
B Extracting email addresses from a folder - how to also get the name of the person the address is for? Using Outlook 5
W Replyin to the reply-to email address Outlook VBA and Custom Forms 0
E How to display "Change Folder" in Change Default Email Delivery Location in Exchange Outlook 2016 Using Outlook 1
M Extract all links from Outlook email, send to Excel Using Outlook 2
O Forward a email with modified body Automatically. Outlook VBA and Custom Forms 0
B Outlook 2003 email sending & receiving suddenly stopped working Using Outlook 3
R List folders in a combo box + select folder + move emails from inbox to that folder + reply to that email Outlook VBA and Custom Forms 1
Similar threads


















































Top