Link to home
Start Free TrialLog in
Avatar of buty
buty

asked on

Mail Attchment with outlook?

Hi every body
I have used the following command to run outlook and make new message with subject and "TO"..etc.
The command is
run("rundll32 url.dll,FileProtocolHandler " + "mailto:a@b.com&subject=Hello")
It's run very nice ,but my problem is How to add to this command attachment to attach files.Any help ,I tried but I can't.
Avatar of namasi_navaretnam
namasi_navaretnam
Flag of United States of America image

Checkout product PowerCube at http://www.beta2alpha.com

regards-
Avatar of gajender_99
gajender_99

hi here is the example in power builder how to send a mail from with attachment


//example

mailSession mSes
mailReturnCode mRet
mailMessage mMsg


//


// Create a mail session
mSes = create mailSession
// Log on to the session
mRet = mSes.mailLogon()
IF mRet <> mailReturnSuccess! THEN
MessageBox("Mail", 'Logon failed.')
RETURN
END IF
// Populate the mailMessage structure
If dw_report.dataobject='dr_arc_card' then
      mMsg.Subject = "Hello How are you" //+ "

     mMsg.NoteText = 'This is the body of mail  '  Auto Generated E-mail by the system'

mmsg.AttachmentFile[1].Filename='foot9.ico'
mmsg.AttachmentFile[1].Pathname='c:\'

mMsg.Recipient[1].name = 'gajender_99@hotmail.com'
mMsg.Recipient[2].name = 'gajender_99@yahoo.com'

// Send the mail
mRet = mSes.mailSend(mMsg)

IF mRet <> mailReturnSuccess! THEN
MessageBox("Mail Send", 'Mail not sent')
RETURN
END IF
mSes.mailLogoff()
DESTROY mSes
hi just change

mMsg.NoteText = 'This is the body of mail  '  Auto Generated E-mail by the system'


to mMsg.NoteText = 'This is the body of mail ~nAuto Generated E-mail by the system'
ASKER CERTIFIED SOLUTION
Avatar of namasi_navaretnam
namasi_navaretnam
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Gentlemen,

Thanks for the discussion on this topic.

I used the examples but was not able to send the attachment until I included the file name in the pathname as per the powerbuilder documentation.

mmsg.AttachmentFile[1].Filename='foot9.ico'
mmsg.AttachmentFile[1].Pathname='c:\foot9.ico'

Thanks again,

Paul