1. rehees rafiq
  2. PowerBuilder
  3. Monday, 11 February 2019

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
0
Votes
Undo

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.
  1. Tuesday, 12 February 2019
  2. PowerBuilder
  3. # 1
John Fauss Accepted Answer Pending Moderation
0
Votes
Undo

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.
  1. Tuesday, 12 February 2019
  2. PowerBuilder
  3. # 2
rehees rafiq Accepted Answer Pending Moderation
0
Votes
Undo

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
mapi doesn't support specifying the sender.

if you need that you should use either SMTP or outlook via OLE.
  1. mike S
  2. Monday, 11 February 2019
There are no comments made yet.
  1. Monday, 11 February 2019
  2. PowerBuilder
  3. # 3
Roland Smith Accepted Answer Pending Moderation
0
Votes
Undo

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.
  1. Monday, 11 February 2019
  2. PowerBuilder
  3. # 4
  • Page :
  • 1


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