I'm not a big user of SMTPMail.p because we have smtp disabled here, and we use MAPI. It seems like most people prefer SMTP. But i found a way to bypass outlook security. Get rid of those annoying windows dialogs that says another program is accessing outlook, do you allow this?
First Before i go further i used a dll for this. It's called redemption.dll and i basically just translated some VB code and came up with this little example on how to do this.
First step is to go to http://www.dimastr.com/redemption/download.htm I downloaded the developer's edition. And click the install file. It basically just puts a redemption folder in prog file or where ever you select it and registers the dll and puts it in that folder.
Basic was to send mail without using this security bypass.
The way to use the redemption bypass
This redemption.dll seems to be pretty cool with all the stuff you can do with it and programming with outlook for anyone out there that would like this.
****Right now i have not heard any negativity on this redemption.dll. Therefore I'm only using this on my local till i find out more, and not putting it on our terminal server. So please use at your own risk.*****
This was another little bit i didn't know where to write this so i wrote it here. Hope this helps out someone.
First Before i go further i used a dll for this. It's called redemption.dll and i basically just translated some VB code and came up with this little example on how to do this.
First step is to go to http://www.dimastr.com/redemption/download.htm I downloaded the developer's edition. And click the install file. It basically just puts a redemption folder in prog file or where ever you select it and registers the dll and puts it in that folder.
Basic was to send mail without using this security bypass.
Code:
DO WITH FRAME {&FRAME-NAME}:
DEFINE VARIABLE attach-name AS CHARACTER NO-UNDO.
DEFINE VARIABLE Folder AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE MailItem AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE message-text AS CHARACTER NO-UNDO.
DEFINE VARIABLE NameSpace AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE Outlook AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE Recipient AS COM-HANDLE NO-UNDO.
CREATE "Outlook.Application" Outlook.
ASSIGN
NameSpace = Outlook:GetNameSpace("MAPI":U)
Folder = NameSpace:GetDefaultFolder(6).
ASSIGN
MailItem = Folder:Items:Add()
MailItem:To = TRIM(scr-To:SCREEN-VALUE)
MailItem:Subject = TRIM(scr-Subject:SCREEN-VALUE)
MailItem:Body = TRIM(ed-Body:SCREEN-VALUE).
MailItem:SEND().
RELEASE OBJECT MailItem NO-ERROR.
RELEASE OBJECT Folder NO-ERROR.
RELEASE OBJECT NameSpace NO-ERROR.
RELEASE OBJECT Outlook NO-ERROR.
RELEASE OBJECT Recipient NO-ERROR.
END.
END PROCEDURE.
Code:
DO WITH FRAME {&FRAME-NAME}:
DEFINE VARIABLE attach-name AS CHARACTER NO-UNDO.
DEFINE VARIABLE Folder AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE MailItem AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE message-text AS CHARACTER NO-UNDO.
DEFINE VARIABLE NameSpace AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE Outlook AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE Recipient AS COM-HANDLE NO-UNDO.
/* A new SafeItem Com-handle */
DEFINE VARIABLE SafeItem AS COM-HANDLE NO-UNDO.
CREATE "Outlook.Application" Outlook.
ASSIGN
NameSpace = Outlook:GetNameSpace("MAPI":U)
Folder = NameSpace:GetDefaultFolder(6)
attach-name = scr-Attach:SCREEN-VALUE.
ASSIGN
MailItem = Folder:Items:Add()
MailItem:To = TRIM(scr-To:SCREEN-VALUE)
MailItem:Subject = TRIM(scr-Subject:SCREEN-VALUE)
MailItem:Body = TRIM(ed-Body:SCREEN-VALUE).
/* Create a SafeItem object from Redemption.SafeMailItem */
CREATE "Redemption.SafeMailItem" SafeItem.
/* Points it to the MailItem */
SafeItem:item = MailItem.
/* Sends it as a SafeItem and not a MailItem */
SafeItem:SEND().
RELEASE OBJECT MailItem NO-ERROR.
RELEASE OBJECT Folder NO-ERROR.
RELEASE OBJECT NameSpace NO-ERROR.
RELEASE OBJECT Outlook NO-ERROR.
RELEASE OBJECT SafeItem NO-ERROR.
END.
END PROCEDURE.
****Right now i have not heard any negativity on this redemption.dll. Therefore I'm only using this on my local till i find out more, and not putting it on our terminal server. So please use at your own risk.*****
This was another little bit i didn't know where to write this so i wrote it here. Hope this helps out someone.