How to include images in e-mail

  • stblink
  • Novice
  • Novice
  • stblink
  • Posts: 22

Post 3+ Months Ago

Hi!

I'm trying to change the registration e-mail of virtuemart to include images.

The e-mail is in \administrator\components\com_virtuemart\languages\common\english.php

Code: [ Select ]
'USEND_MSG_ACTIVATE' => 'Hello %s,
 
Thank you for registering at %s. Your account is created and must be activated before you can use it.
To activate the account click on the following link or copy-paste it in your browser:
%s
 
After activation you may login to %s using the following username and password:
 
Username - %s
Password - %s',
  1. 'USEND_MSG_ACTIVATE' => 'Hello %s,
  2.  
  3. Thank you for registering at %s. Your account is created and must be activated before you can use it.
  4. To activate the account click on the following link or copy-paste it in your browser:
  5. %s
  6.  
  7. After activation you may login to %s using the following username and password:
  8.  
  9. Username - %s
  10. Password - %s',



This is what i've changed to:

Code: [ Select ]
'USEND_MSG_ACTIVATE' => '?>
   <div><img src="www.mydomain.com/templates/mytemplate/images/error.png"></div><?php
   Hello %s,
 
Thank you for registering at %s. Your account is created and must be activated before you can use it.
To activate the account click on the following link or copy-paste it in your browser:
%s
 
After activation you may login to %s using the following username and password:
 
Username - %s
Password - %s',
  1. 'USEND_MSG_ACTIVATE' => '?>
  2.    <div><img src="www.mydomain.com/templates/mytemplate/images/error.png"></div><?php
  3.    Hello %s,
  4.  
  5. Thank you for registering at %s. Your account is created and must be activated before you can use it.
  6. To activate the account click on the following link or copy-paste it in your browser:
  7. %s
  8.  
  9. After activation you may login to %s using the following username and password:
  10.  
  11. Username - %s
  12. Password - %s',


This is the e-mail i receive:

Code: [ Select ]
?><div><img src="www.mydomain.com/templates/mytemplate/images/error.png"></div><?php
Hello Pedro Migu,
 
Thank you for registering at start. Your account is created and must be activated before you can use it.
To activate the account click on the following link or copy-paste it in your browser:
...
...
  1. ?><div><img src="www.mydomain.com/templates/mytemplate/images/error.png"></div><?php
  2. Hello Pedro Migu,
  3.  
  4. Thank you for registering at start. Your account is created and must be activated before you can use it.
  5. To activate the account click on the following link or copy-paste it in your browser:
  6. ...
  7. ...


Also tried this way:

Code: [ Select ]
'USEND_MSG_ACTIVATE' => '<div><img src="www.mydomain.com/templates/mytemplate/images/error.png"></div>
   Hello %s,
 
Thank you for registering at %s. Your account is created and must be activated before you can use it.
To activate the account click on the following link or copy-paste it in your browser:
%s
 
After activation you may login to %s using the following username and password:
 
Username - %s
Password - %s',
  1. 'USEND_MSG_ACTIVATE' => '<div><img src="www.mydomain.com/templates/mytemplate/images/error.png"></div>
  2.    Hello %s,
  3.  
  4. Thank you for registering at %s. Your account is created and must be activated before you can use it.
  5. To activate the account click on the following link or copy-paste it in your browser:
  6. %s
  7.  
  8. After activation you may login to %s using the following username and password:
  9.  
  10. Username - %s
  11. Password - %s',


And nothing!
He reads it as plain text, how can i "say" to read it as html so that he can output it correctly?

Thanks
Peter
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • satya-prakash
  • Graduate
  • Graduate
  • User avatar
  • Posts: 134
  • Loc: Bangalore

Post 3+ Months Ago

You can use these kind of headers:
$headers = "From: \"$fromName\" <$fromMail>" . "\r\n" .
"Reply-To: \"$fromName\" <$fromMail>" . "\r\n" .
"Return-Path: \"$fromName\" <$fromMail>". "\r\n" .
"Message-Id: <".time().".xyz@$domain>" ."\r\n".
'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/html; charset=iso-8859-1'. "\r\n".
'X-Mailer: PHP-'. PHP_VERSION;

See the "Content-Type". It is important.

To all I suggest one phpmailer
because I found it is useless to waste time trying to use simple php function. With this you easily do what you want in mail.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 124 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.