SSL Email

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
edauthier
Pro Scripter
Posts: 84
Joined: Sun Apr 13, 2003 1:26 pm
Location: USA

SSL Email

Post by edauthier » Tue Dec 02, 2008 7:33 pm

SMTP macroscripts. Some email servers will not allow outside domain relay emails - only internal. Even with relay enabled on the server it still wants the email client to ssl authnticate. In this case it's Macro Scheduler, not an actual email client.

I looked around a bit and the best option to quickly convert SMTP scripts is to use a vbscript calling Outlook. It hasn't been great. example:

Code: Select all

VBSTART
Function SendEmail(toaddr,bccaddr,fromaddr,subject,body,html)
    Set cdoConfig = CreateObject("CDO.Configuration")
    With cdoConfig.Fields
        .Item(sch & "sendusing") = 2 ' cdoSendUsingPort
        .Item(sch & "smtpserver") = "myEmailServer"
        .update
    End With

    Set cdoMessage = CreateObject("CDO.Message")

    With cdoMessage
       Set .Configuration = cdoConfig
        .From = fromaddr
        .To = toaddr
        .Bcc = bccaddr
        .Subject = subject
        .AddAttachment "c:\Your Attachment"
           .TextBody = body
        end if
        .Send
    End With

    Set cdoMessage = Nothing
    Set cdoConfig = Nothing
End Function
VBEND

Let>body=Today's Subject

StringReplace>body,","",body
VBEval>SendEmail("[email protected]","[email protected]","[email protected]","DailyEmail","%body%",1),res

Anybody have a VBScript/SMTP solution?

Thanks, Ed

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Dec 02, 2008 11:49 pm

I have used command lines in other programs to send email with Outlook

Caution: This is from memory, and I cannot test now, so be prepared for an error or two.

Code: Select all

Let>[email protected]
Let>vSubj=This is a test of the Subject line
Let>vPath=C:\Program Files\Microsoft Office\Office\OUTLOOK.EXE
Let>vAttach=C:\folder\filename.tst
Let>vBody=This is a test of the body of an Outlook email
RunProgram>%vPath% /c ipm.note /a %vAttach% /m mailto: %vEmail%?Subject=%vSubj%&body=vBody
I have also used command lines with Thunderbird, but have lost all recall on that syntax, so Google for "Thunderbird command line" Many other email clients also have command lines for use with RunProgram
(Run Program for Macro Scheduler before version 11)
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Dec 03, 2008 12:08 am

To the best of my recollection, using same variables as earlier:

Syntax for Mozilla and Thunderbird:

Code: Select all

Let>vPath=C:\Program Files\Microsoft Office\Office\OUTLOOK.EXE
RunProgram>%vPath% -nosplash -compose 
to=%vEmail%,body=%vBody%,subject=%vSubj%,attachment=%vAttach%
Syntax for Outlook Express:

Code: Select all

Let>vPath=C:\Program Files\Outlook Express\msimn.exe
RunProgram>%vPath% /mailurl:mailto: %vEmail%?Subject=%vSubj% 
I don't recall the switch for attachments in Outlook Express.

Again, both from memory, be prepared to edit.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Dec 03, 2008 1:59 am

Sorry, I just realized that the sample command lines I provided above actually open the email client, they do not actually send the email. Will have to research the command lines for each of them to see if that switch exists.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts