Releative Newbie

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
wedmonds
Forum Newbie
Posts: 6
Joined: Wed Jul 29, 2009 10:03 am

Releative Newbie

Post by wedmonds »

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
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Releative Newbie

Post by jackpf »

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.
wedmonds
Forum Newbie
Posts: 6
Joined: Wed Jul 29, 2009 10:03 am

Re: Releative Newbie

Post by wedmonds »

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! :banghead:
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Releative Newbie

Post by jackpf »

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! :)
wedmonds
Forum Newbie
Posts: 6
Joined: Wed Jul 29, 2009 10:03 am

Re: Releative Newbie

Post by wedmonds »

ok, thanks for your help..... :)

Anyone else able to comment?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Releative Newbie

Post by pickle »

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.
wedmonds
Forum Newbie
Posts: 6
Joined: Wed Jul 29, 2009 10:03 am

Re: Releative Newbie

Post by wedmonds »

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
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Releative Newbie

Post by pickle »

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.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Releative Newbie

Post by onion2k »

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.
wedmonds
Forum Newbie
Posts: 6
Joined: Wed Jul 29, 2009 10:03 am

Re: Releative Newbie

Post by wedmonds »

Thanks guys.

Off to start a post in the swift forum now :) :banghead:
Post Reply