Article Details
Id:11066
Product:finPOWER Connect
Type:NEW
Version:1.06.08
Opened:26/03/2013
Closed:10/04/2013
Released:28/05/2013
Job: J011368

Emails; Specifying 'Reply To' details is now supported from the business layer

The ability to specify 'Reply To' details when sending an Email is now supported from the business layer.

The ISMessageProviderRequest object has been updated with the following properties:

  • ReplyToEmailAddress
  • ReplyToName

The 'Reply To' details are used by the SMTP provider and the Outlook 2000 provider although the later does not use the ReplyToName.

NOTE: Some SMTP Servers (e.g., the Office 365 servers) may not allow the Sender details to differ from the details configured to log in to the SMTP Server (defined under Global Settings or User Preferences).

The following example creates a request and sends an Email. Because a Message Target of 'Send' is specified, the SMTP provider will automatically be selected if configured under Global Settings or User Preferences:

Dim Request As ISMessageProviderRequest

' Create Request
Request = finBL.CreateMessageProviderRequest()
With Request
  .RecipientsTo.Add("recipient@email.zzz", "recipient name")

  .Subject = "test subject"
  .Body = "test <b>bold</b> body."

  .MessageFormat = iseMessageFormat.Html
  .MessageTarget = iseMessageTarget.Send

  .SenderEmailAddress = "my@email.zzz"
  .SenderName = "my name"

  .ReplyToEmailAddress = "replyto@email.zzz"
  .ReplyToName = "reply to name"
End With

' Send
Main = finBL.SendEmailByRequest(Request)

This code example forces the use of the Outlook 2000 provider (this could also be forced using a MessageTarget of 'Open for Edit'):

Dim Request As ISMessageProviderRequest

' Create Request
Request = finBL.CreateMessageProviderRequest()
With Request
  .RecipientsTo.Add("recipient@email.zzz", "recipient name")

  .Subject = "test subject"
  .Body = "test <b>bold</b> body."

  .MessageFormat = iseMessageFormat.Html
  .MessageTarget = iseMessageTarget.OpenForEdit

  .ReplyToEmailAddress = "replyto@email.zzz"
  .ReplyToName = "reply to name"
End With

' Send via Outlook
Main = finBL.MessageProviders.Item("MSOutlook2000").Execute(Request)

NOTE: If you specify Sender details, these are ignored by the Outlook 2000 provider.