• 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
send email with html tags

#5
(12-24-2014, 04:09 AM)Rufnex Wrote: Try also



PHP Code:
$this->email->set_mailtype("html"); 

And check if you have als an email.php in your config folder. Maye you overwrite there your settings.

when I'm sending mail like this, this is working så there is something with setting content type in CI, and I dont get it, I do the way CI says, but it's not working.

the way it's works

PHP Code:
               $to $email;
 
               $subject "forgotten password";

 
               $message "
                <html>
                <head>
                <title>Your Password</title>
                </head>
                <body>
                <h2>hi,this->username</h2>
                <div><p>your new password is: <b>newpassword</b></p><p>you can log in with this than you can change your password on your profile page.</p><p><a href=''>Go to login page</a></p></div>
                </body>
                </html>
                "
;

 
               // Always set content-type when sending HTML email
 
               $headers "MIME-Version: 1.0" "\r\n";
 
               $headers .= "Content-type:text/html;charset=UTF-8" "\r\n";

 
               $headers .= 'From: bla bla' "\r\n";


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


here is the what I'm receiving when I try to send CI way, an I see there is text/plain - t's not text/html in contnet type

PHP Code:
Subject: =?utf-8?Q?send_email_to_costomer?=
Toahmet@hotmail.com
X
-PHP-Originating-Script0:Email.php
User
-AgentCodeIgniter
Date
Wed24 Dec 2014 22:39:18 +0000
From
: <rws@hotmail.com>
Return-
Path: <rws@hotmail.com>
Reply-To"[email protected]<rws@hotmail.com>
X-Senderrws@hotmail.com
X
-MailerCodeIgniter
X
-Priority(Normal)
Message-ID: <549b409610661@hotmail.com>
Mime-Version1.0
Content
-Typemultipart/alternativeboundary="B_ALT_549b40961066f"

This is a multi-part message in MIME format.
Your email application may not support this format.

--
B_ALT_549b40961066f
Content
-Typetext/plaincharset=utf-8
Content
-Transfer-Encoding8bit

success
 your message send successfuly
!!


--
B_ALT_549b40961066f
Content
-Typetext/htmlcharset=utf-8
Content
-Transfer-Encodingquoted-printable

<!DOCTYPE HTML>
<
html lang=3D"en-US">
<
head>
    <
meta charset=3D"UTF-8">
    <
title></title>
</
head>
<
body>
    <
h1>success</h1>
 <
p>your message send <b>successfuly!!</b></p>
</
body>
</
html>

--
B_ALT_549b40961066f-- 

I want to send this CI way to learn. I gave many hours to this now!!
Reply


Messages In This Thread
send email with html tags - by valencia - 12-23-2014, 03:27 PM
RE: send email with html tags - by Avenirer - 12-23-2014, 05:13 PM
RE: send email with html tags - by valencia - 12-23-2014, 07:04 PM
RE: send email with html tags - by Rufnex - 12-24-2014, 04:09 AM
RE: send email with html tags - by valencia - 12-24-2014, 03:43 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.