BooBoo2004
asked on
How to specify the sender's email address or reply-to email address when using PB 10 & Outlook
I have created an application that allows our users to email preformatted messages to customers concerning their orders. We were using Outlook Express, but now, we are using MS Exchange and MS Outlook. I cannot specify the sender's email address that should be used by everyone or the reply-to email address (if one exists).
Basically, I need the ability to will allow the different users to send an email to a customer and when the customer replies back to the email, it will go to one email address, as in orders@xxxxxxxxx.com.
I have gotten around the profile issue in that everyone has the same profile name. But when an email is sent via the application, instead of having the orders@xxxxxxxxx.com email address in the sender's email address, it has the default email address of the user.
The code that I am using is as follows:
If lb_goodtosend = True Then
// Create a mail session
mSes = create mailSession
// Log on to the session
mRet = mSes.mailLogon("profilenam e", "profile password", mailNewSession!)
IF mRet <> mailReturnSuccess! THEN
MessageBox("Mail", 'Logon failed.')
RETURN
END IF
// Populate the mailMessage structure
mMsg.Subject = ls_subject
mMsg.NoteText = ls_message
li_array = 1
mMsg.Recipient[li_array].R ecipientTy pe = mailTo!
mMsg.Recipient[li_array].n ame = ls_sendto
if ls_copyto <> "" Then
li_array++
mMsg.Recipient[li_array].R ecipientTy pe = mailcc!
mMsg.Recipient[li_array].n ame = ls_copyto
End If
// Send the mail
mRet = mSes.mailSend(mMsg)
IF mRet <> mailReturnSuccess! THEN
MessageBox("Mail Send", 'Mail not sent')
RETURN
END IF
mSes.mailLogoff()
DESTROY mSes
End If
Thanks in advance!
Keith Roberts
Basically, I need the ability to will allow the different users to send an email to a customer and when the customer replies back to the email, it will go to one email address, as in orders@xxxxxxxxx.com.
I have gotten around the profile issue in that everyone has the same profile name. But when an email is sent via the application, instead of having the orders@xxxxxxxxx.com email address in the sender's email address, it has the default email address of the user.
The code that I am using is as follows:
If lb_goodtosend = True Then
// Create a mail session
mSes = create mailSession
// Log on to the session
mRet = mSes.mailLogon("profilenam
IF mRet <> mailReturnSuccess! THEN
MessageBox("Mail", 'Logon failed.')
RETURN
END IF
// Populate the mailMessage structure
mMsg.Subject = ls_subject
mMsg.NoteText = ls_message
li_array = 1
mMsg.Recipient[li_array].R
mMsg.Recipient[li_array].n
if ls_copyto <> "" Then
li_array++
mMsg.Recipient[li_array].R
mMsg.Recipient[li_array].n
End If
// Send the mail
mRet = mSes.mailSend(mMsg)
IF mRet <> mailReturnSuccess! THEN
MessageBox("Mail Send", 'Mail not sent')
RETURN
END IF
mSes.mailLogoff()
DESTROY mSes
End If
Thanks in advance!
Keith Roberts
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Please close this question. No points to be awarded as the question was not answered.
ASKER
I did discover the Outlook Redemption object and I am fooling around with this. I will post my results shortly.
Thanks for the rapid response!