I am trying to send mail after doing some operations in PowerBuilder 8. But it pops up an Outlook pop up message asking whether to allow Outlook to send message or not.
Is There any way to bypass this pop up and send mail directly? If the answer is redemption please let me know where to use it in my below code-
//string ls_name
//integer id
ls_name = sle_name.text
id = integer(sle_id.text)
dw_report.Saveas("d:\abc.xls", Excel!, True)
mailSession mSes
mailReturnCode mRet
mailMessage mMsg
// Create a mail session
mSes = create mailSession
// Log on to the session
mRet = mSes.mailLogon(mailNewSession!)
IF mRet <> mailReturnSuccess! THEN
MessageBox("Mail", 'Logon failed.')
RETURN
END IF
// Populate the mailMessage structure
mMsg.Subject = ls_name
mMsg.NoteText = 'Recieved Mail From PB'
mMsg.Recipient[1].name = 'priyadarsini_m01@infosys.com'
//mMsg.AttachmentFile[1].file = 'D:\EB130157\EB130157_22.doc'
mMsg.AttachmentFile[1].FileType = mailAttach!
mMsg.AttachmentFile[1].FileName = 'abc.xls'
mMsg.AttachmentFile[1].PathName = 'D:\abc.xls'
mMsg.AttachmentFile[1].position = 1
//mMsg.Recipient[2].name = 'Shaw, Sue'
// Send the mail
mRet = mSes.mailSend(mMsg)
IF mRet <> mailReturnSuccess! THEN
MessageBox("Mail Send", 'Mail not sent')
RETURN
END IF
mSes.mailLogoff()
DESTROY mSes