chanh_trung
New Member
Seems to be ok with codes like this:
DEFINE VARIABLE objOutlook AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE objOutlookMsg AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE objOutlookAttach AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE objOutlookRecip AS COM-HANDLE NO-UNDO.
CREATE "Outlook.Application" objOutlook.
objoutlookMsg = objOutlook:CreateItem(0).
objOutlookRecip = objOutlookMsg:Recipients:Add(vTo).
objOutlookRecip:Type = 1.
objOutlookMsg:Subject = vSubject.
objOutlookMsg:Body = vBody.
objOutlookMsg:Attachments:Add(vFile).
objOutlookRecip:Resolve.
objOutlookMsg:Send.
objoutlook:Quit().
RELEASE OBJECT objOutlook.
RELEASE OBJECT objOutlookMsg.
RELEASE OBJECT objOutlookRecip.
But then, there are 2 problems that I need your advice:
1. MS Outlook will ask for permission to send email. How can I avoid this? (since gonna send hundred mails)
2. the attachement will be given 'dat' as extension name. Why? And how can we avoid this?
Thanks so much.
DEFINE VARIABLE objOutlook AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE objOutlookMsg AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE objOutlookAttach AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE objOutlookRecip AS COM-HANDLE NO-UNDO.
CREATE "Outlook.Application" objOutlook.
objoutlookMsg = objOutlook:CreateItem(0).
objOutlookRecip = objOutlookMsg:Recipients:Add(vTo).
objOutlookRecip:Type = 1.
objOutlookMsg:Subject = vSubject.
objOutlookMsg:Body = vBody.
objOutlookMsg:Attachments:Add(vFile).
objOutlookRecip:Resolve.
objOutlookMsg:Send.
objoutlook:Quit().
RELEASE OBJECT objOutlook.
RELEASE OBJECT objOutlookMsg.
RELEASE OBJECT objOutlookRecip.
But then, there are 2 problems that I need your advice:
1. MS Outlook will ask for permission to send email. How can I avoid this? (since gonna send hundred mails)
2. the attachement will be given 'dat' as extension name. Why? And how can we avoid this?
Thanks so much.