Mywoody
asked on
Send PDF Attachment using IBM Lotus notes email with PowerBuilder classic 12.5
Hi,
Try to automate send PDF attachment ( datawindow save as PDF file in a specific folder directory path, then from powerbuilder automatic send this attachment to email address. )
The following code allow me to open the lotus notes email with the right email address, subject and message note; however it didn't get the PDF file attachment even I hard code the
file name and file path. Any suggestion how to handle this. I already look at your answear, but it is not work for my case.
Thanks
mailSession mSes
//mailrecipient mrecipient
mailReturnCode mRet
mailMessage mMsg
mailFileDescription mAttach
// Create a mail session
mSes = create mailSession
// Log on to the session
mRet = mSes.mailLogon(mailNewSess ion!)
IF mRet <> mailReturnSuccess! THEN
MessageBox("Mail", 'Logon failed.')
RETURN -1
END IF
// set up for attachment
mMsg.Subject = 'Test' // str_email.subject
mMsg.NoteText = 'Test PDF attachment send ' // str_email.message
mMsg.Recipient[1].name = 'ttttt@css.com' // str_email.address
mAttach.FileType =mailAttach!
mAttach.Filename = 'Q#12345v10'
mAttach.Pathname = 'c:\dev\' + 'Q#12345v10'
mAttach.Position = len (str_email.message) - 1
mMsg.AttachmentFile[1] = mAttach
mRet = mSes.mailSend(mMsg)
IF mRet <> mailReturnSuccess! THEN
MessageBox("Mail Send", 'Mail not sent')
RETURN -1
END IF
mSes.mailLogoff()
DESTROY mSes
Try to automate send PDF attachment ( datawindow save as PDF file in a specific folder directory path, then from powerbuilder automatic send this attachment to email address. )
The following code allow me to open the lotus notes email with the right email address, subject and message note; however it didn't get the PDF file attachment even I hard code the
file name and file path. Any suggestion how to handle this. I already look at your answear, but it is not work for my case.
Thanks
mailSession mSes
//mailrecipient mrecipient
mailReturnCode mRet
mailMessage mMsg
mailFileDescription mAttach
// Create a mail session
mSes = create mailSession
// Log on to the session
mRet = mSes.mailLogon(mailNewSess
IF mRet <> mailReturnSuccess! THEN
MessageBox("Mail", 'Logon failed.')
RETURN -1
END IF
// set up for attachment
mMsg.Subject = 'Test' // str_email.subject
mMsg.NoteText = 'Test PDF attachment send ' // str_email.message
mMsg.Recipient[1].name = 'ttttt@css.com' // str_email.address
mAttach.FileType =mailAttach!
mAttach.Filename = 'Q#12345v10'
mAttach.Pathname = 'c:\dev\' + 'Q#12345v10'
mAttach.Position = len (str_email.message) - 1
mMsg.AttachmentFile[1] = mAttach
mRet = mSes.mailSend(mMsg)
IF mRet <> mailReturnSuccess! THEN
MessageBox("Mail Send", 'Mail not sent')
RETURN -1
END IF
mSes.mailLogoff()
DESTROY mSes
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Mywoody