1. rehees rafiq
  2. PowerBuilder
  3. Monday, 11 February 2019 11:48 AM UTC

Hi

Using a PBSession to send out emails via an application.

How do I change the sender's email address?

MS Office Outlook 2010

 

Roland Smith Accepted Answer Pending Moderation
  1. Tuesday, 12 February 2019 14:33 PM UTC
  2. PowerBuilder
  3. # 1

You could use SMTP to send the emails. SMTP communicates directly with the email server, bypassing Outlook completely. You can set the from address to anything you want.

http://www.topwizprogramming.com/pbnismtp.html

 

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 12 February 2019 03:57 AM UTC
  2. PowerBuilder
  3. # 2

Have you tried supplying the optional "profile"  & "password" argument values to the mailSession.mailLogon function? I have not tried this myself (I generate emails from MS Outlook via OLE) but it might change the sender by using a non-default profile.

The PB-supplied Mail objects are adequate for simple emails, but once you need to go beyond their limited capabilities, you should use OLE if you want to send email via Outlook.

Comment
There are no comments made yet.
rehees rafiq Accepted Answer Pending Moderation
  1. Monday, 11 February 2019 15:38 PM UTC
  2. PowerBuilder
  3. # 3

I am creating a MailSession in my PB code.

 

And within here declare local instances of variables

MailSession  PBMailSession

MailRecipient   PBMailRecipient
MailMessage    PBMailMessage

PBMailSession = CREATE mailSession

....

...

PBMailMessage.Subject =
PBMailMessage.NoteText =

PBMailMessage.Recipient[1].name = xxx@ebrd.com

 

There is no equivalent of 'MailItem object has a property SenderEmailAddress' in MailSession.

 

 

Comment
  1. mike S
  2. Monday, 11 February 2019 22:31 PM UTC
mapi doesn't support specifying the sender.

if you need that you should use either SMTP or outlook via OLE.
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 11 February 2019 15:13 PM UTC
  2. PowerBuilder
  3. # 4

If you are using OLE to send email via Outlook, the MailItem object has a property SenderEmailAddress.

https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2007/bb175525(v%3doffice.12)

If you aren't using OLE to send email via Outlook, please give more details.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.