EllisLab text mark
Advanced Search
     
CodeIgniter email library problem in Yahoo
Posted: 12 May 2011 06:39 PM
Joined: 2010-09-01
64 posts

Hello evrybody
i’ve a problem in sending email to yahoo .
i sent an email to yahoo Mail and gmail by email library but my email message didn’t shows in Yahoo mail it meaning Yahoo receives my email and shows email subject but email message body is empty but all everything in gmail in ok :D

it’s my code and configurations

email config

$config['protocol''mail';
$config['mailpath''/usr/sbin/sendmail';
$config['mailtype''html';
$config['charset''utf-8';
$config['wordwrap'FALSE;
$config['priority'1

and my code

$msg'
<center>
<table style="width: 80% ;border: 1px solid #3399FF;">
    <tr>
        <td style="text-align: center;font-family: Tahoma;    font-size: small;    direction: rtl;    background-color: #66CCFF;">%title%</td>
    </tr>
    <tr>
        <td style="text-align: right;font-family: Tahoma;    font-size: small;">%text%</td>
    </tr>
</table>
</center>
        '
;
        
        
$msg str_replace('%text%',$this->UTF_to_Unicode('سلام '),$msg);
        
$msg str_replace('%title%',$this->UTF_to_Unicode('عنوان'),$msg);
        
$this->email->clear();
        
$this->email->from('test@example.com''تست ');
        
$this->email->to('my_email@yahoo.com');        
        
$this->email->subject('سلام');
        
$this->email->message($msg);
        
        
$this->email->send(); 

what is my mistake ?

Best Regards
Ali

 
Posted: 13 May 2011 12:44 AM   [ # 1 ]   [ Rating: 0 ]
Joined: 2009-03-30
1317 posts

Just to rule out the obvious, have you checked you spam filter? And you can try:

$this->email->send();
echo 
$this->email->print_debugger(); 

This may print something useful. Since some servers are wanting more information in the email header for validation.

 
Posted: 13 May 2011 06:50 AM   [ # 2 ]   [ Rating: 0 ]
Joined: 2010-09-01
64 posts
pickupman - 13 May 2011 04:44 AM

Just to rule out the obvious, have you checked you spam filter? And you can try:

$this->email->send();
echo 
$this->email->print_debugger(); 

This may print something useful. Since some servers are wanting more information in the email header for validation.

yes, i’m checked the spam filter and it is not my problem . and the result of print_debugger() is

Your message has been successfully sent using the following protocolmail

User
-AgentTest
Date
Fri13 May 2011 14:16:52 +0430
From
: =?utf-8?Q?=d8=aa=d8=b3=d8=aa_?= 
Return-
Path
Reply-To"info4@test.com" 
X-Senderinfo4@test.com
X
-MailerTest
X
-Priority(Highest)
Message-ID: <4dccfe0ced139@test.com>
Mime-Version1.0
Content
-Typemultipart/alternativeboundary="B_ALT_4dccfe0ced154"

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

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

عنوان

سلام 


--B_ALT_4dccfe0ced154
Content
-Typetext/htmlcharset=utf-8
Content
-Transfer-Encodingquoted-printable
=?utf-8?B?2LPZhNin2YU=?=

<
center>
<
table style=3D"width: 80% ;border: 1px solid #3399FF;">
    <
tr>
        <
td style=3D"text-align: center;font-family: Tahoma;    font-size: small;    di=
rection: rtl;    background-color: #66CCFF;"
>&#1607;&#1606;&#1608;&#1575;&#160;=
6;</td>
    </
tr>
    <
tr>
        <
td style=3D"text-align: right;font-family: Tahoma;    font-size: small;">&#=
1587;&#1604;&#1575;&#1605;&#32;</td>
    
</tr>
</
table>
</
center>

--
B_ALT_4dccfe0ced154-- 

There are any problem in the debugger result ?

Thanks

 
Posted: 13 May 2011 10:27 AM   [ # 3 ]   [ Rating: 0 ]
Joined: 2009-03-30
1317 posts

Wonder if your ip address you maybe sending from maybe black(grey)listed. Do you have any other location you could send from? Doing some googling yields some results with yahoo being picky about html only. What happens if you try sending using smtp?

 
Posted: 14 May 2011 11:13 AM   [ # 4 ]   [ Rating: 0 ]
Joined: 2010-09-01
64 posts
pickupman - 13 May 2011 02:27 PM

Wonder if your ip address you maybe sending from maybe black(grey)listed. Do you have any other location you could send from? Doing some googling yields some results with yahoo being picky about html only. What happens if you try sending using smtp?

i sent from 2 ip addresses in Iran & Netherlands but i think ip address is not my problem because Yahoo receives my email and shows subject of my email and ... but only didn’t shows message body .
about smtp ? i didn’t realize you . can you please explian more about ?
i am using “Best SMTP Server” program in localhost to send email via localhost ? do you have any other idea ?


Best Wishes
Ali

 
Posted: 14 May 2011 12:44 PM   [ # 5 ]   [ Rating: 0 ]
Joined: 2009-03-30
1317 posts

Ah, different issue. I was reading “email message not received” that it never shows up in yahoo mail at all. If you are missing the message body, I would guess it to be some encoding issue. Since you are currently trying to send a ‘html’ type, try $config[‘text’].

Out of curiosity, if you are sending via localhost smtp server, why have you used sendmail in your configuration?

 
Posted: 14 May 2011 01:05 PM   [ # 6 ]   [ Rating: 0 ]
Joined: 2010-09-01
64 posts
pickupman - 14 May 2011 04:44 PM

Ah, different issue. I was reading “email message not received” that it never shows up in yahoo mail at all. If you are missing the message body, I would guess it to be some encoding issue. Since you are currently trying to send a ‘html’ type, try $config[‘text’].

Out of curiosity, if you are sending via localhost smtp server, why have you used sendmail in your configuration?

i set up sendmail for using in host , but sendmail didn’t work without smtp server :D
about text messagge , Yahoo have not any problem with text mails , i only want use html email smile

 
Posted: 14 May 2011 01:17 PM   [ # 7 ]   [ Rating: 0 ]
Joined: 2009-03-30
1317 posts

Just double checked your message source. You don’t have a valid html source. Try this:

$msg'
<html>
<head><title>Your title</title></head>
<body>
  <center>
  <table style="width: 80% ;border: 1px solid #3399FF;">
      <tr>
          <td style="text-align: center;font-family: Tahoma;    font-size: small;    direction: rtl;    background-color: #66CCFF;">%title%</td>
      </tr>
      <tr>
          <td style="text-align: right;font-family: Tahoma;    font-size: small;">%text%</td>
      </tr>
  </table>
  </center>
</body>
</html> 
 
Posted: 14 May 2011 01:47 PM   [ # 8 ]   [ Rating: 0 ]
Joined: 2010-09-01
64 posts
pickupman - 14 May 2011 05:17 PM

Just double checked your message source. You don’t have a valid html source. Try this:

$msg'
<html>
<head><title>Your title</title></head>
<body>
  <center>
  <table style="width: 80% ;border: 1px solid #3399FF;">
      <tr>
          <td style="text-align: center;font-family: Tahoma;    font-size: small;    direction: rtl;    background-color: #66CCFF;">%title%</td>
      </tr>
      <tr>
          <td style="text-align: right;font-family: Tahoma;    font-size: small;">%text%</td>
      </tr>
  </table>
  </center>
</body>
</html> 

now yahoo don’t receives even my email !! smile  i don’t know what is my problem , but i think it’s for sending from localhost and another problem was in my html code that was not valid html ( Thanks for sending valid html of message body ) . i think your html code working fine now in yahoo . out of this discussion , how can i send email from localhost without other programs like “Best SMTP Server” which i am using ? i am using xampp .

Thanks a lot for your answers wink

 
Posted: 14 May 2011 01:55 PM   [ # 9 ]   [ Rating: 0 ]
Joined: 2009-03-30
1317 posts

Glad you are on the right track. Several ISPs allow you to send if you have an email address setup. You would use the same settings for an email client (email address, password, mail server).

Example:

$config['smtp_host''mail.myisp.com';
$config['smtp_user''me@myisp.com';
$config['smtp_pass''password';
$config['smpt_port''25';
$config['protocol']  'smtp'

If you don’t have an email address setup with your ISP, and use gmail, you can send via smtp with your gmail account.

$config['protocol']  'smtp';
$config['smtp_host''ssl://smtp.googlemail.com';
$config['smtp_port''465';
$config['smtp_timeout''30';
$config['smtp_user''me@gmail.com';
$config['smtp_pass''password';
$config['charset']  'utf-8';
$config['newline']  "\r\n"

I use both locally on Windows using Wamp.

 
Posted: 14 May 2011 02:20 PM   [ # 10 ]   [ Rating: 0 ]
Joined: 2010-09-01
64 posts
pickupman - 14 May 2011 05:55 PM

Glad you are on the right track. Several ISPs allow you to send if you have an email address setup. You would use the same settings for an email client (email address, password, mail server).

Example:

$config['smtp_host''mail.myisp.com';
$config['smtp_user''me@myisp.com';
$config['smtp_pass''password';
$config['smpt_port''25';
$config['protocol']  'smtp'

If you don’t have an email address setup with your ISP, and use gmail, you can send via smtp with your gmail account.

$config['protocol']  'smtp';
$config['smtp_host''ssl://smtp.googlemail.com';
$config['smtp_port''465';
$config['smtp_timeout''30';
$config['smtp_user''me@gmail.com';
$config['smtp_pass''password';
$config['charset']  'utf-8';
$config['newline']  "\r\n"

I use both locally on Windows using Wamp.

WoW , Thanksss a looooottt :-x
i used gmail smtp and it working very fast and good , now yahoo can receives HTML mails whithout any problem
thanks so much for your helps , it was a great help to me , Thanks again

 
Posted: 14 May 2011 02:47 PM   [ # 11 ]   [ Rating: 0 ]
Joined: 2009-03-30
1317 posts

Great. I guessed that could been a lot easier to begin with.

 
Posted: 03 July 2013 11:07 AM   [ # 12 ]   [ Rating: 0 ]
Joined: 2010-09-03
10 posts

Hi All,
I am not sure if anyone has used SuPHP with codeigniter. After 1.5 days we found out that there seems to be a bug in the email library.

We’ve created a simple form that sends out HTML email and it works. However when we tried to send out the email in HTML format, the email gets stucked i.e. not sent out at all.

At first we thought it was an issue with Flexi Auth email activation but after trial and error we found that it just does not seem to work with CI. We do have two other servers where the html email works without any problems.
$config[‘protocol’] = ‘xxx’;
  $config[‘host’] = ‘smtp’;
  $config[‘user’] = ‘xxx’;
  $config[‘password’] = ‘xxx’;
  $config[‘port’] = ‘25’;
  $config[‘charset’] = ‘iso-8859-1’;
  $config[‘newline’] = ‘\r\n’;
  $config[‘mailtype’] = ‘text’;
  $config[‘wordwrap’] = TRUE;
  $this->email->initialize($config);

We’ve tried with standard settings as well as smtp. Does anyone have a solution or has encountered this before?

Thank you.
Best regards
Ashar

 
Posted: 03 July 2013 02:13 PM   [ # 13 ]   [ Rating: 0 ]
Joined: 2009-03-30
1317 posts

We’ve tried with standard settings as well as smtp. Does anyone have a solution or has encountered this before?

It’s hard to guess based on our smtp and isp. As I had mentioned 2 years ago, my isp didn’t let me send via smtp.  I had to use gmail in order to send messages. As to the format being the issue, is the message body getting created when trying HTML format? Maybe there is an error in your body that is causing errors. Perhaps and encoding issue? Have you tried another character set?

 
Posted: 03 July 2013 05:59 PM   [ # 14 ]   [ Rating: 0 ]
Avatar
Joined: 2013-02-12
233 posts

did u check the spams sir?

 
Posted: 04 July 2013 03:02 AM   [ # 15 ]   [ Rating: 0 ]
Joined: 2010-09-03
10 posts

My two cents worth.

Its worth to try and use the debugger so that we could see what exactly is going on when we do not get the email. In most situation is that the mail settings (sendmail, smtp) etc is not compatible. If you have different servers to test on then you could clearly (perhaps quickly) find out the cause smile

cheers
Ashar