• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Send email by outlook

#1
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.
 
#2
There is no way that I know of to prevent the confirmation message from coming up. I attempted to create an automated way of sending e-mail messages, but ended up creating a VB program that did all the nasty work of SMTP server and calling it from my PROGRESS application.