- Sathishkumar S
- PowerBuilder
- Friday, 13 October 2023 04:53 PM UTC
Hi All,
I am using PB2022 R2 SMTP client,
In my development environment I am able to send and receive email whereas sender and recipient are getting added but when I make a build move to QA environment SetSender& AddRecipient is setting as Null, so the send() also returns null, unable to send email.
unable to set sender and recipient in QA environment
Below is the code section only setting as null.
il_sender= lnv_SmtpClient.Message.SetSender('sathishkumar@email.com')
MessageBox('il_sender', string(il_sender))
il_recp = lnv_SmtpClient.Message.AddRecipient(trim('sathishkumar@email.com'))
MessageBox('il_recp', string(il_recp))
SMTPClient lnv_SmtpClient
Integer numResultCode
lnv_SmtpClient = CREATE SMTPClient
string ls_host, ls_user, ls_pass
Boolean lb_tls
long ll_port
INTEGER il_sender, il_recp
string ls_sub, ls_textb
lnv_SmtpClient.Host = trim(dw_1.object.Host[1])
lnv_SmtpClient.EnableTLS = (dw_1.object.tls[1] = "Y")
lnv_SmtpClient.Port = dw_1.object.port_nbr[1]
lnv_SmtpClient.Username = dw_1.object.ls_userName[1]
lnv_SmtpClient.password = dw_1.object.ls_password[1]
ls_host = lnv_SmtpClient.Host
MessageBox('ls_host', string(ls_host))
lb_tls = lnv_SmtpClient.EnableTLS
MessageBox('lb_tls', string(lb_tls))
ll_port = lnv_SmtpClient.Port
MessageBox('ll_port', string(ll_port))
ls_user = lnv_SmtpClient.Username
MessageBox('ls_user', string(ls_user))
ls_pass = lnv_SmtpClient.password
MessageBox('ls_pass', string(ls_pass))
il_sender= lnv_SmtpClient.Message.SetSender(dw_form.object.from_emailaddress[1])
MessageBox('il_sender', string(il_sender))
il_recp = lnv_SmtpClient.Message.AddRecipient(trim(sle_test.text))
MessageBox('il_recp', string(il_recp))
lnv_SmtpClient.Message.Subject = "Test Message"
ls_sub = lnv_SmtpClient.Message.Subject
MessageBox('ls_sub', string(ls_sub))
lnv_SmtpClient.Message.TextBody = "The message has been sent successfully."
ls_textb = lnv_SmtpClient.Message.TextBody
MessageBox('ls_textb', string(ls_textb))
numResultCode = lnv_SmtpClient.Send()
How to resolve it.
Thanks in advance.
Regards
Sathishkumar.
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.