How to send an email using PageProducer in Delphi 7? - delphi

I am making an application in Delphi 7 and I need to send an email using PageProducer component in order to make it in HTML format. At this point, the objective is to send the email in both formats: text/plain and text/html, but really know how to send it in only one format: either text/plain or text/html. So, how to send an email using PageProducer in both formats: plain and HTML??
I need that because there are webmail servers that don't accept HTML emails.

PageProducer is just a component for producing HTML content by replacing some tags with your specified content. It has no feature for sending emails.
To send email in Delphi 7, you can use IdSMTP component from Indy Clients tab in Components Palette. As it is clear from its name, this component uses SMTP protocol for sending emails.
In your case, you should first generate HTML content using either PageProducer or any other method, and then pass the HTML content to IdSMTP to be sent as an email.
To send an email in both plain text and HTML format you should use multi-part message. You can refer to Indy help for TIdMessage class.
Regards

You should take a look at the MIME format. This is the format the email is finally sent.
If you understand it you will be able to send Multipart messgaes containing text/plain text/html or attachments.
http://en.wikipedia.org/wiki/MIME

Related

Working with HTML files in iOS Dev (Swift + Xcode)

I have an HTML file (a template file for sending email). I'm using SendGrid to email users the receipt once they purchase something. I need to add some information to the HTML template file (pass a string values such as address, price, date of purchase, etc) before passing it to the SendGrid object.
A solution that came to my mind was to simply pass the HTML string but this is a bad solution since a template HTML will contain some javascript and other things.
What's the best solution to this problem?
I'm quite sure the best solution for this is to notify a service -> have the service send the HTML Script/Email or whatever it is you've made.
Sending the parameters you need to your backend/api and have that send the email.

Forward and reply email using DELPHI and INDY 10 components

Does Indy component suite offers any functions or support or e mail forewarding or reply to ... processing.
I expect the mail body is extended with the sending params. Using other mail programs sometimes the mail text is changed the the > character for each line.
You use TIdPOP3 or TIdIMAP4 to receive emails, and TIdSMTP to send emails. Replying/Forwarding is just a matter of downloading a TIdMessage via POP3/IMAP, updating its Recipients, Subject, etc as needed, and then sending it with SMTP.

Email Disclaimer missing on multipart/alternative

I am using Indy in Delphi to create and send emails to an exchange mail server.
For messages with only one part, the exchange server correctly adds a disclaimer. However if I create emails with mutlipart/alternative, with both plain text and a html message parts, exchange does not add the disclaimer.
I'm thinking I must have structured my email wrong?
Can you check the FallbackAction in Exchange transport rules ?
If it can't add the disclaimer for some reason, it will either:
Send it without one (ignore)
Send a new message with the original attached (wrap)
Reject it (reject)
Maybe setting to wrap will solve the problem...

MHT sending mail with Indy

My question is how to send a mht message throw Indy 9 with Delphi 7 IDE?
Thanks in advance!
MHT is a format for saving an HTML document and associated resources into a single file. To send such a document as an email, you would have to extract the HTML and resource data first and put them into a TIdMessage component like other HTML-formatted email. There are articles on Indy's website for how to send HTML emails with Indy.
Have a look at RFC 2557 for how MHTML interacts with email.

Problem sending HTML Mails using MAPI and Outlook

I am trying sending HTML e-mails using MAPI calls in my Delphi Application.
When the client is Thunderbird if works fine. But when the client is Microsoft Outlook or Outlook Express I need to save the HTML code in a file and send it as the first attachment of my message, elsewhere the mail client interpret the HTML as text, showing the tags.
Sending HTML as the first attachment works only when no more attachments are sent, because if I send one or more attachments the first (HTML) is also showed as an attachment.
Does somebody can help me?
Thanks in advance.
Douglas.
Message OK:
Ok http://www.freeimagehosting.net/uploads/e51dfa52f4.jpg
Bad Message (with one attachment):
Bad http://www.freeimagehosting.net/uploads/7e5689e2b9.jpg
If you find that Outlook/OutlookExpress can not handle HTML natively, it might just be that you are using a version of Outlook that isn't capable of, or isn't configured to default to HTML rich content by default. Have you tried reconfiguring your Outlook/OutlookExpress options to select HTML rich text by default?
It looks like it's actually working, but that Outlook does not display things correctly. An HTML email sent via a traditional email client, is actually mime-encoded, just as it shows there. In other words, you may find that if the email is sent, it appears fine on the other side, it's just a bug in outlook-express that you don't see the MIME attached content in the window, instead you see it as it is truly done internally, as a MIME encoded attachment.

Resources