Gubbins Posted April 20, 2010 Share Posted April 20, 2010 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: [email protected]\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: ­ 8bit\r\n\r\n"; mail ($to, $subject, $message, $headers); Link to comment https://forums.phpfreaks.com/topic/199156-email-with-an-image/ Share on other sites More sharing options...
NTSmarkv Posted April 20, 2010 Share Posted April 20, 2010 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 /> Link to comment https://forums.phpfreaks.com/topic/199156-email-with-an-image/#findComment-1045332 Share on other sites More sharing options...
Gubbins Posted April 20, 2010 Author Share Posted April 20, 2010 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 https://forums.phpfreaks.com/topic/199156-email-with-an-image/#findComment-1045354 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.