(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?=
To: ahmet@hotmail.com
X-PHP-Originating-Script: 0:Email.php
User-Agent: CodeIgniter
Date: Wed, 24 Dec 2014 22:39:18 +0000
From: <rws@hotmail.com>
Return-Path: <rws@hotmail.com>
Reply-To: "[email protected]" <rws@hotmail.com>
X-Sender: rws@hotmail.com
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <549b409610661@hotmail.com>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_549b40961066f"
This is a multi-part message in MIME format.
Your email application may not support this format.
--B_ALT_549b40961066f
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
success
your message send successfuly!!
--B_ALT_549b40961066f
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-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!!