Jump to content

Email with an image


Gubbins

Recommended Posts

Hello,

I have tried to make a email that includes a small banner picture at the top of the email before the main text.

If it is possible could someone please show me where in the code i could add the image address?

 

$to = "".$name." <".$email.">";
$subject = "Test Login Details";
$message = "Thankyou for registering at Test, your login details are as follows:
<br />
<br />
Playername: <b>".$name."</b>
<br />
Password: <b>".$password."</b>
<br />
<br />
You can now login at: <a href=\"http://www.test.com\">http://www.test.com</a>
<br />
<br />
If you have any questions or queries please contact us (via the contact link at the bottom of the login page or message <b>Mr Test</b>) and we will be happy to assist you in what ever troubles you.
<br />
<br />
You can now follow us on <b>Twitter</b> <url>http://twitter.com/test</url><br />
and on <b>Facebook</b> <url>http://www.facebook.com/test</url></center><br />
<br />
<i>Kind Regards
<br />
test team</i>
<br />";
$headers = "From: test@test.com\r\n" .
       'X-Mailer: PHP/' . phpversion() . "\r\n" .
       "MIME-Version: 1.0\r\n" .
       "Content-Type: text/html; charset=utf-8\r\n" .
       "Content-Transfer-Encoding: &#173; 8bit\r\n\r\n";

mail ($to, $subject, $message, $headers);

Link to comment
Share on other sites

Add your image into a variable:

 

$html ="<img src='beerchug.gif'>

then in $msg call the variable.. at the very beginning 

 

example:

 

$message = "$html;<br />Thankyou for registering at Test, your login details are as follows:

<br />

 

It worked when i added closed quotes to the

$html ="<img src='beerchug.gif'>";

but at the end of the image in the email i get ; <---that symbol..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.