1. Options for sending email

Hi,

My company wants to send out automated emails (mainly remittance advices) from a small accounting utility that they want me to write. ATM they scan the hardcopy and manually email it to the supplier. Their current accounting software (for supplier payments) is so lame it cannot automate such a basic business task. In a few years they'll upgrade but right now my job is to tidy up this process.

Another utility that I wrote for the company creates, prints, and uploads invoice data into our main accounting system. Out of that system we email _most_ of the invoices to customers.

If I knew how to send emails from my programs I could unify & streamline that entire area of our company process. So what are my options for intelligently sending automated emails?

From email.exw et al I have added Simple MAPI routines to my program but this relies on there being support for this in the default email client to work. In MS Outlook a security feature keeps prompting the user to verify each email being sent. When sending eg, 100, emails at a time, it would be quite tedious to keep clicking some button those 100 times. Is there a way to avoid this? I haven't figured out how to send (correct) credentials to the MAPI routines. What if I sent the email data directly to the SMTP server instead?

Maybe someone with direct experience on this would like to comment/advise..

TIA

Spock

new topic     » topic index » view message » categorize

2. Re: Options for sending email

Spock said...

If I knew how to send emails from my programs I could unify & streamline that entire area of our company process. So what are my options for intelligently sending automated emails?

Maybe someone with direct experience on this would like to comment/advise..

I have done this before.

Spock said...

What if I sent the email data directly to the SMTP server instead?

If you can do this, then in my experience this is the best method.

Here's a simple, very stupid, quick&dirty example that sends a plain text email w/o any error or exception handling: http://openeuphoria.org/pastey/246.wc

Note that attaching files to an email is a little bit trickier - you need to add some MIME data and use base64:encode to encode the file, then append that to the end of the email's text body.

Spock said...

From email.exw et al I have added Simple MAPI routines to my program but this relies on there being support for this in the default email client to work. In MS Outlook a security feature keeps prompting the user to verify each email being sent. When sending eg, 100, emails at a time, it would be quite tedious to keep clicking some button those 100 times. Is there a way to avoid this? I haven't figured out how to send (correct) credentials to the MAPI routines.

You have to use the extended MAPI to get around this. It's quite involved. This is the simplest example I could find: https://mail.python.org/pipermail/python-win32/2004-August/002239.html

You'd need a MAPIEx wrapper though. Not sure if anyone has made one for Euphoria yet. If not, then the simplest thing to do would be to take this, http://www.codeproject.com/Articles/10881/MAPIEx-Extended-MAPI-Wrapper , and then wrap the C using C, then wrap the C code with an Euphoria wrapper.

new topic     » goto parent     » topic index » view message » categorize

3. Re: Options for sending email

jimcbrown said...
Spock said...

If I knew how to send emails from my programs I could unify & streamline that entire area of our company process. So what are my options for intelligently sending automated emails?

Maybe someone with direct experience on this would like to comment/advise..

I have done this before.

Spock said...

What if I sent the email data directly to the SMTP server instead?

If you can do this, then in my experience this is the best method.

Here's a simple, very stupid, quick&dirty example that sends a plain text email w/o any error or exception handling: http://openeuphoria.org/pastey/246.wc

Note that attaching files to an email is a little bit trickier - you need to add some MIME data and use base64:encode to encode the file, then append that to the end of the email's text body.

Spock said...

From email.exw et al I have added Simple MAPI routines to my program but this relies on there being support for this in the default email client to work. In MS Outlook a security feature keeps prompting the user to verify each email being sent. When sending eg, 100, emails at a time, it would be quite tedious to keep clicking some button those 100 times. Is there a way to avoid this? I haven't figured out how to send (correct) credentials to the MAPI routines.

You have to use the extended MAPI to get around this. It's quite involved. This is the simplest example I could find: https://mail.python.org/pipermail/python-win32/2004-August/002239.html

You'd need a MAPIEx wrapper though. Not sure if anyone has made one for Euphoria yet. If not, then the simplest thing to do would be to take this, http://www.codeproject.com/Articles/10881/MAPIEx-Extended-MAPI-Wrapper , and then wrap the C using C, then wrap the C code with an Euphoria wrapper.

Jim,

Thanks for the quick reply (and the example). I agree with you that an SMTP module would be the best way to go.

[If I ever get stuck writing this code I'll know who to ask for help.. ]

Spock

new topic     » goto parent     » topic index » view message » categorize

4. Re: Options for sending email

My company uses programs I've built to send emails many times a day. I make use of BLAT in this whole thing. Why reinvent the wheel? :D

new topic     » goto parent     » topic index » view message » categorize

5. Re: Options for sending email

Oops! Check out EuBlat!

new topic     » goto parent     » topic index » view message » categorize

6. Re: Options for sending email

euphoric said...

Oops! Check out EuBlat!

Hi CK,

I've just tried this but it didn't work for some reason. Would you mind posting the command string you use to send the emails? TIA.

Spock

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu