2 Ways to Email?!

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Dexter1
Pro Scripter
Posts: 64
Joined: Mon Jun 19, 2006 3:28 pm

2 Ways to Email?!

Post by Dexter1 » Thu Nov 16, 2006 6:47 pm

Upon looking at some examples and reading the manual, I see that there are two ways to send an email using code. One is the native Macro Scheduler code and the other is to call VBA.

I have a form which allows me to email selected files to a specific address but I'm using the MS code and so must enter the entire email address, rather than the Outlook abbreviation i.e. [email protected] as opposed to Smith.John.

Code: Select all

Input>Email, Enter Email Addresses

   Let>SendMail_Status=1
   Let>Subject=Database Installation
   Let>[email protected]
   Let>MyName=John Smith
   Let>Recipients=%Email%
   Let>body=Follow these instructions to install the attached database.%CRLF%%CRLF%1. Open the attached .zip file.%CRLF%2. In the WinZip window, double-click the .exe file.%CRLF%You will then have the database ready to use on your desktop.%CRLF%%CRLF%Please feel free to contact me with any questions or difficulties.%CRLF%%CRLF%Thanks,%CRLF%John Smith%CRLF%x1070
   Let>Attachments=\\File\Location\Install.zip

   SMTPSendMail>recipients,server.com,me,myname,subject,body,attachments
   MDL>The database was sent to %email%
Is there a way I can use the Outlook version of the address when entering the address using this method? Or do I have to rewrite everything in VBA?
Thanks,
Josh

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 » Thu Nov 16, 2006 9:48 pm

Maybe make an ascii file from Outlook that can be parsed in Macro Scheduler.

Or use VBA with Outlook to create an INI file everytime you add/modify/delete email info.

Then use MS with the INI file to pass in the friendly name, and get back the email address.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Nov 16, 2006 9:57 pm

Is there a way I can use the Outlook version of the address when entering the address using this method? Or do I have to rewrite everything in VBA?
That depends. If you're in a corporate environment running under Exchange Server then you probably CAN just use the Outlook format. This is because the Exchange server will know the alias and handle it appropriately.

And some SMTP servers will cope too if the mail box is set up appropriately and known to that domain. E.g. when sending via MJTNet's smtp server I can use a local alias.

But if you are sending via a third party SMTP server that doesn't know anything about the recipient then you'd need the full email address.

So the answer is, it depends ....
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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