Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

trying to attach file to email

3 views
Skip to first unread message

Mike T

unread,
Feb 8, 2010, 11:26:34 PM2/8/10
to
I'm trying to attach a file to an email. The email it self works fine,
but the file is not attached. I've found a few samples on the web, but
none actually work.

here's my code.
mailSession mSes
mailReturnCode mRet
mailMessage mMsg
mailFileDescription mAttach

// Create a mail session
mSes = create mailSession
// Log on to the session
mRet = mSes.mailLogon(mailNewSession!)
IF mRet = mailReturnSuccess! THEN
// Populate the mailMessage structure
mMsg.Subject = "Mobile Order"
mMsg.NoteText = "New Sales Order " + String(gl_current_order)
mMsg.Recipient[1].name = ProfileString(gs_ini_filename,"Defaults",
"Email To Address", "")

mAttach.Filename = is_filename
mAttach.Pathname = ""
mAttach.FileType = mailAttach!
mAttach.Position = len(mMsg.NoteText) + 1
mMsg.AttachmentFile[ 1 ] = mAttach
// Send the mail
mSes.mailSend(mMsg)

I sure would appreciate it if someone could spot the problem.

Mike

Mike T

unread,
Feb 9, 2010, 7:50:34 PM2/9/10
to
Got it.

The filename was not properly set. And the pointer is not needed.

0 new messages