I am developing an agent that will send an Order Confirmation to our customer after they select to complete their order on our site.
I am receiving the following delivery failure:
Error transferring to mx01.xyz.net; SMTP Protocol Returned a Permanent Error 553 5.5.2 Invalid mailbox: bad return-path syntax
The below code is what is being used to generate the email confirmation which is a sub-routine within the agent that processes the order:
Msgbox ("Send email confirmation")
Dim session As New NotesSession
Dim maildb As NotesDatabase
Dim maildoc As NotesDocument
Set maildb = session.CurrentDatabase
Set maildoc = New NotesDocument( maildb )
maildoc.Form = "Memo"
maildoc.From = "firstname.lastname@example.org"
maildoc.Principal = "email@example.com"
If (orderdoc.bEmail(0) <> orderdoc.sEmail(0)) Then
Dim recipients( 1 To 2 ) As String
recipients( 1 ) = orderdoc.bEmail(0)
recipients( 2 ) = orderdoc.sEmail(0)
maildoc.SendTo = recipients
maildoc.SendTo = orderdoc.bEmail(0)
Dim recipientsbcc( 1 To 2 ) As String
recipients( 1 ) = "firstname.lastname@example.org"
recipients( 2 ) = "email@example.com"
maildoc.BlindCopyTo = recipientsbcc
maildoc.Subject = "Thank you for placing your order with XYZ, Inc."
maildoc.Body = |Dear | + orderdoc.Contact(0) + |,| +Chr(10) + Chr(10) +_
|Thank you for placing your order with XYZ Inc. Your order number is | +_
orderdoc.Loc(0) + | - | + orderdoc.OrdNum(0) + |. You will receive a complete order confirmation when your order has been booked by our | +_
|Customer Service department, which will state the estimated ship date(s) of the products ordered. If you have questions, please contact | +_
|us at 877-123-1234 or check our web site at http://www.xyz.com
for your Order Status. | + Chr(10) + Chr(10) + _
"Sincerely," + Chr(10) + Chr(10) + Chr(10) +_
"Webmaster" + Chr(10) +_
"firstname.lastname@example.org" + Chr(10) +_
"Visit us today at http://www.xyz.com
Call maildoc.Send( False )
Also, how do I get the email to display as coming from "email@example.com" instead of a me. I tried changing the agent security 'Run on behalf of' but then the agent will not run at all.
Any assistance would be greatly appreciated.