Releative Newbie
Moderator: General Moderators
Releative Newbie
Hi Guys,
I am relatively new to PHP and I am creating an e-mail that will confirm to customers what they have purchased.
Could someone advise on how I go about telling the script to include a specific company logo hosted on a remote site?
(the sort of thing you get from itunes as confirmation on your purchase would be ideal)
I would welcome any views or comments on the best way to achieve this.
Thanks all
wedmonds
I am relatively new to PHP and I am creating an e-mail that will confirm to customers what they have purchased.
Could someone advise on how I go about telling the script to include a specific company logo hosted on a remote site?
(the sort of thing you get from itunes as confirmation on your purchase would be ideal)
I would welcome any views or comments on the best way to achieve this.
Thanks all
wedmonds
Re: Releative Newbie
So you just want images in your email?
You'll need to send the correct headers, such as mime type, content version etc.
This might be of some use.
You'll need to send the correct headers, such as mime type, content version etc.
This might be of some use.
Re: Releative Newbie
Thanks for reply.
I was on the right lines. I decided to use the following:
$headers .= "X-Mailer: PHP\r\n";
$headers .= "Mime-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=utf-8\n";
$headers .= "X-Priority: 1\r\n";
Is it then a simple case of adding <img src="http://www.example.com/logo.jpg" alt="logo" /> ???
sorry!
I was on the right lines. I decided to use the following:
$headers .= "X-Mailer: PHP\r\n";
$headers .= "Mime-Version: 1.0\n";
$headers .= "Content-Type: text/html; charset=utf-8\n";
$headers .= "X-Priority: 1\r\n";
Is it then a simple case of adding <img src="http://www.example.com/logo.jpg" alt="logo" /> ???
sorry!
Re: Releative Newbie
I believe so. I've never sent html with the mail() function, so I'm not entirely sure.
The only way to find out is to test it and see!
The only way to find out is to test it and see!
Re: Releative Newbie
ok, thanks for your help..... 
Anyone else able to comment?
Anyone else able to comment?
Re: Releative Newbie
I'd strongly recommend using SwiftMailer. The development team has done tons of work to make sure any emails you send via SwiftMailer are completely standards based. This includes having a plaintext equivalent to any html email that goes out.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: Releative Newbie
Thanks I will take a look at this.
I have also been told that I should look at Pear.
What is the general view on the best program to use?
Requirements now being:
1. Ability to be send e-mail and conifigure the layout very specifically. ( I would like to add logo's, images etc and have it layed out really nicely )
2. Compatability with multiple mail systems. Idelaly the mail would check what the receipient's mail server is using before delievery the best version.
3. Security.
Thank you all for your views... they all help me!
wedmonds
I have also been told that I should look at Pear.
What is the general view on the best program to use?
Requirements now being:
1. Ability to be send e-mail and conifigure the layout very specifically. ( I would like to add logo's, images etc and have it layed out really nicely )
2. Compatability with multiple mail systems. Idelaly the mail would check what the receipient's mail server is using before delievery the best version.
3. Security.
Thank you all for your views... they all help me!
wedmonds
Re: Releative Newbie
PEAR doesn't do anything useful for your code per se. It is a repository system for downloading code & classes that are useful. So there's likely a PEAR module out there for sending email, but PEAR itself won't send your email.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: Releative Newbie
Also, in my experience, code in PEAR is incredibly variable in terms of quality. Some of it is brilliant but some of it is worse than useless.
If you're sending HTML email then Swiftmailer is the best option by miles. PHPMailer comes a distant second. PEAR's offerings just aren't good enough.
If you're sending HTML email then Swiftmailer is the best option by miles. PHPMailer comes a distant second. PEAR's offerings just aren't good enough.
Re: Releative Newbie
Thanks guys.
Off to start a post in the swift forum now

Off to start a post in the swift forum now