Sending emails

Blitz3D Forums/Blitz3D Programming/Sending emails

Farflame(Posted 2006) [#1]
I'm using B3D which is why I'm posting here.

Does anyone know if it's possible to send emails directly from B3D, and to add attachments? I have to regularly send out alot of text files to customers by email. Currently I'm doing this manually.

The name (not the email) of the customer is in the file, so what I'd like B3D to do, is to retrieve the name (easy bit), match it up with the names in my Outlook address book (is that possible), then make the email and add the file as an attachment.

Is this possible?


DJWoodgate(Posted 2006) [#2]
Yes, it is possible. There is a simple example on the code archives,

You will need to learn how to encode attachments and will need to read up on SMTP.
Edit. Well maybe not, I forgot about this...
http://www.blitzbasic.com/codearcs/codearcs.php?code=1448

Outlook integration may be a bit more difficult and I suspect require a DLL interface unless you can access the outlook address file directly which I doubt is possible given Microsofts new concerns about security, but hey who knows :) Thinking about it though, maybe Outlook allows you to export the address book in some easily readable format? That may be worth looking into.

Edit. I have just checked and you should be able to export to a CSV file which can be easily parsed by Blitz. See http://help.yahoo.com/help/us/ab/impexp/impexp-15.html

I am sure all of this would be easier to do from within Outlook itself though, perhaps with some scripting. That is the avenue I would explore first anyway. If you ask nicely on some MS support forum someone may even come up with a script for you.


Farflame(Posted 2006) [#3]
Ok, I'll look into the Outlook scripting idea first. Not sure what that is, but it sounds good :)