D
dougolivier
I am creating an email message in PB10 with an attachment. It gets into
Outlook without a problem, but somehow the Outlook Message Type which should
be SMTP
is overridden with the email address that I assign to the recipient address
field. Is there someplace that I can force the message type or am I doing
something wrong. Is there some field that I should search for to make sure
that I'm not setting something wrong... Is there a good reference site for
email variables and how to properly use them?
Thanks, Douglas
Below is my code:
string notetext, filename
mailSession mSes
mailReturnCode mRet
mailMessage mMsg
mailRecipient mRecip
mailFileDescription mAttach
// 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 = subject
notetext = fw_email_text(curr_row)
if isNull(notetext) then notetext = '...Message is Intentially Blank...'
mMsg.notetext = notetext
filename = "attach.pdf"
if fileexists(g_ini_settings.file_directory +"\"+filename) then
mattach.filename = filename
mattach.pathname = g_ini_settings.file_directory +"\"+filename
mMsg.AttachmentFile[1] = mAttach
end if
mMsg.Recipient[1].name = email_name
mMsg.Recipient[1].address = email_add
// Send the mail
mRet = mSes.mailSend(mMsg)
IF mRet <> mailReturnSuccess! THEN
MessageBox("Mail Send", 'Mail not sent to '+email_name)
RETURN
END IF
filedelete(g_ini_settings.file_directory +"\"+filename)
mSes.mailLogoff()
DESTROY mSes
return
Outlook without a problem, but somehow the Outlook Message Type which should
be SMTP
is overridden with the email address that I assign to the recipient address
field. Is there someplace that I can force the message type or am I doing
something wrong. Is there some field that I should search for to make sure
that I'm not setting something wrong... Is there a good reference site for
email variables and how to properly use them?
Thanks, Douglas
Below is my code:
string notetext, filename
mailSession mSes
mailReturnCode mRet
mailMessage mMsg
mailRecipient mRecip
mailFileDescription mAttach
// 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 = subject
notetext = fw_email_text(curr_row)
if isNull(notetext) then notetext = '...Message is Intentially Blank...'
mMsg.notetext = notetext
filename = "attach.pdf"
if fileexists(g_ini_settings.file_directory +"\"+filename) then
mattach.filename = filename
mattach.pathname = g_ini_settings.file_directory +"\"+filename
mMsg.AttachmentFile[1] = mAttach
end if
mMsg.Recipient[1].name = email_name
mMsg.Recipient[1].address = email_add
// Send the mail
mRet = mSes.mailSend(mMsg)
IF mRet <> mailReturnSuccess! THEN
MessageBox("Mail Send", 'Mail not sent to '+email_name)
RETURN
END IF
filedelete(g_ini_settings.file_directory +"\"+filename)
mSes.mailLogoff()
DESTROY mSes
return