Link to home
Start Free TrialLog in
Avatar of BooBoo2004
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("profilename", "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].RecipientType = mailTo!
      mMsg.Recipient[li_array].name = ls_sendto
      if ls_copyto <> "" Then
            li_array++
            mMsg.Recipient[li_array].RecipientType = mailcc!
            mMsg.Recipient[li_array].name = 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
ASKER CERTIFIED SOLUTION
Avatar of gajender_99
gajender_99

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BooBoo2004
BooBoo2004

ASKER

Unfortunately, the database idea will not work.  I need to send the email from within an existing email application.  The user will process an order.  If the csr needs more info, the csr will generate an email by selecting the order, clicking a button, and selecting the correct canned text, and then sends the email to the user.

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!
Please close this question.  No points to be awarded as the question was not answered.