Welcome Guest, Not a member yet? Register   Sign In
Strange Email Issue
#1

[eluser]macmonkey[/eluser]
I'm using CI for the first time and have spent plenty of time in the manual.

I'm using the Email Library to send a registration confirmation email but it is hanging up in everyone's spam folder.

In addition the spam folder problem the html message that DOES show up up has random "=" equal signs throughout.

Here is my debug stuff:

Code:
User-Agent: CodeIgniter
Date: Wed, 13 Aug 2008 23:57:02 -0400
From: "--MYDOMAIN-- Team:"
Return-Path:
To: --MYEMAIL--
Subject: --MYDOMAIN--.com Registration Email
Reply-To: "[email protected]"
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0


Content-Type: multipart/alternative; boundary="B_ALT_48a3ad0f05c4c"
This is a multi-part message in MIME format.
Your email application may not support this format.

--B_ALT_48a3ad0f05c4c
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

You recently requested a new password. To reset your password, follow the
link below:
http://--MYDOMAIN--.com/password_reset/index/7ec8bcedd65a67ab74f7c6e39fa06f7ce0998877/
(If clicking on the link doesn't work, try copying and pasting it into your
browser.) If you did not reset your password, please disregard this message.
Check out http://www.--MYDOMAIN--.com/beta/userguide/1 for more
questions. --MYDOMAIN-- Team:


--B_ALT_48a3ad0f05c4c
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

You recently requested a new password. To reset your password, follow the l=
ink below: <br /><br /> http://--MYDOMAIN--.com/password_reset/index/7e=
c8bcedd65a67ab74f7c6e39fa06f7ce0998877/ <br /><br /> (If clicking on the li=
nk doesn't work, try copying and pasting it into your browser.) <br /> If y=
ou did not reset your password, please disregard this message. Check out ht=
tp://www.--MYDOMAIN--.com/beta/userguide/1 for more questions. <br /><=
br /> --MYDOMAIN-- Team:

--B_ALT_48a3ad0f05c4c--

Any help is greatly appreciated.
#2

[eluser]Derek Jones[/eluser]
Have you hacked the email class? That's using quoted-printable mime encoding but is reporting to the MUA that it's 8bit. My suggestion would be to grab the latest copy of the email class from the SVN to eliminate any possible hacks and to receive the benefit of some recent changes.
#3

[eluser]tonanbarbarian[/eluser]
Derek

You imply that if the encoding is 8bit that it should not be using quoted-printable, yet neither CI 1.6.3, nor the latest version from SVN appear to take the encoding into account.
I have just had to extend my Email library to fix a problem with this.
I basically added a new property to the class and if it was set i added the
Content-Transfer-Encoding: quoted-printable header and then called $this->_prep_quoted_printable otherwise I do not.
I had to do this because if I did not turn this off Outlook 2003 and Outlook 2007 would not handle the quoted_printable format correctly. In the best case the links did not work and in the worst case the message contained = at various places in the body of the message.

Is there some rule in Email processing that if using an 8bit encoding quoted-printable is not needed?
And if so maybe the email library should reflect this correctly.
In the meantime I will continue with my modification because it seems to be working, however I would like some feedback on this as I am planning to convert an email marketing application I built to CI and want to be sure this will not be an issue.

Thanks
#4

[eluser]Derek Jones[/eluser]
I think you're misunderstanding. The HTML portion of your email should have:

Code:
Content-Transfer-Encoding: quoted-printable

not

Code:
Content-Transfer-Encoding: 8bit

As you have in your output above. When you send HTML emails, the HTML portion will be prepped for quoted printable automatically, this is not something that you handle in your controllers. Your messages are rendering with = signs because the MUA doesn't know that the content is using the quoted-printable MIME type, where the = is an escape character.

This indicates that you are either using the library incorrectly, or it is not up to date, or has been modified.
#5

[eluser]tonanbarbarian[/eluser]
Ok I can see that, however having worked with PHPMailer library before I notice that in that library you can set different encoding that is handled different ways

7bit or 8bit just has EOL processing, and quoted-printable has similar processing to the one used in the CI email library.

Is this ability to determine the transfer encoding going to be added to the CI email library?
Because as I stated I found an issue with Outlook not supporting quoted-printable correctly, (or perhaps it does not like the way CI implements it I have not checked fully)
So my hack has essentially allowed me to use a different transfer encoding, although I now realise that I should be setting the tranfer encoding to 8bit or similar if I have turned off quoted-printable.

I am actually considering using PHPMailer for the time being as I have used that extensively before and know it has no issues.
#6

[eluser]Derek Jones[/eluser]
Outlook works fine with CI's quoted-printable MIME encoding. Remove your hacks, use the latest email class from the SVN, and try it again. If you have problems, post your controller code and attach the content you are trying to send.
#7

[eluser]Zuki[/eluser]
Hello,

I have the same problem with my HTML email. I have just downloaded the latest CI version and it doesn't help -- I still have random equal signs throughout my email body. Below is my controller code. Please help, thank you!

Code:
$this->load->library('email');

$config['mailtype'] = 'html';
$this->email->initialize($config);

$msg = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
&lt;html &gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;Your order&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
<p>Thank you for your order</p>';

... long message here

$msg .= '&lt;/body&gt;
&lt;/html&gt;';

$this->email->message($msg);
$this->email->send();
#8

[eluser]Derek Jones[/eluser]
Did you get the file from the SVN or the release version? The latest changes are not in the release version yet.
#9

[eluser]Zuki[/eluser]
I got it from SVN at http://dev.ellislab.com/svn/CodeIgniter/...libraries/
#10

[eluser]Derek Jones[/eluser]
Your sample controller works just fine for me in all MUAs I have access to.

1) What is the server environment?
2) What MUA are you receiving the email with?
3) What is the RAW source of the received email?
4) Please post the full controller method and content, without leaving anything out (other than using example.com email addresses for display purposes).




Theme © iAndrew 2016 - Forum software by © MyBB