Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1141
  • Last Modified:

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.')
      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
            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')
      END IF


      DESTROY mSes
End If

Thanks in advance!

Keith Roberts
  • 2
2 Solutions
what you need is the mailbox for that user or the on the pc from where you are sending the email
and when you have the mail box on that pc  then
you must use the username and password to login and send mail

 mRet = mSes.mailLogon("profilename", "profile password", mailNewSession!)
                                       username       password
In MS SQL2000 you can set up a stored procedure to send emails which would all have the same 'sender' address.  Write your order info / text to a table; set up a scheduled job to query the table at regular intervals; then trigger the stored procedure to retrieve the data from the table, format the message, then send it.
BooBoo2004Author Commented:
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!
BooBoo2004Author Commented:
Please close this question.  No points to be awarded as the question was not answered.

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now