Sending email with attachment from your Delphi application using http

I wanted to send emails from Picto-Selector and I was using my own SMTPserver for this. However SMTP is often blocked and it even triggered a firewall in the past when some people from different locations were sending emails almost at the same time…

application

So I looked for a way to send email with attachment using my webserver. I came up with the code in this example

You will need to replace the password ‘useyourownpassword’ in both the Delphi and php code to use it on your own webserver.

Part of the php code
phpcode

The delphi code is in fact doing this:

htmlcode

This is done in Delphi with a Indy HTTP component:

delphicode

Advertisements

About Picto-Selector

Creator of Picto-Selector, father of 3 children, one of them Autistic
This entry was posted in Delphi, Picto Selector, Software. Bookmark the permalink.

4 Responses to Sending email with attachment from your Delphi application using http

  1. I tried to turn off firewall but no success. Let’s try this simple script, thanks a lot!

  2. achristouio says:

    Might have a limitation on upload file size. Often set default to 8 kb or so.

  3. achristouio says:

    You can also use the put command to send the file and also get to receive files using a stream to receive the file(s)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s