Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter email library problem in Yahoo
#1

[eluser]Ali Fattahi[/eluser]
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 Big Grin

it's my code and configurations

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

and my code
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('[email protected]', 'تست ');
        $this->email->to('[email protected]');        
        $this->email->subject('سلام');
        $this->email->message($msg);
        
        $this->email->send();
what is my mistake ?

Best Regards
Ali
#2

[eluser]pickupman[/eluser]
Just to rule out the obvious, have you checked you spam filter? And you can try:
Code:
$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.
#3

[eluser]Ali Fattahi[/eluser]
[quote author="pickupman" date="1305276297"]Just to rule out the obvious, have you checked you spam filter? And you can try:
Code:
$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.[/quote]

yes, i'm checked the spam filter and it is not my problem . and the result of print_debugger() is
Code:
Your message has been successfully sent using the following protocol: mail

User-Agent: Test
Date: Fri, 13 May 2011 14:16:52 +0430
From: =?utf-8?Q?=d8=aa=d8=b3=d8=aa_?=
Return-Path:
Reply-To: "[email protected]"
X-Sender: [email protected]
X-Mailer: Test
X-Priority: 1 (Highest)
Message-ID: <[email protected]>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_4dccfe0ced154"

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

--B_ALT_4dccfe0ced154
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

عنوان

سلام


--B_ALT_4dccfe0ced154
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-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;">هنوا =
6;</td>
    </tr>
    <tr>
        <td style=3D"text-align: right;font-family: Tahoma;    font-size: small;">&#=
1587;لام </td>
    </tr>
</table>
</center>

--B_ALT_4dccfe0ced154--

There are any problem in the debugger result ?

Thanks
#4

[eluser]pickupman[/eluser]
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?
#5

[eluser]Ali Fattahi[/eluser]
[quote author="pickupman" date="1305311229"]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?[/quote]
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
#6

[eluser]pickupman[/eluser]
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?
#7

[eluser]Ali Fattahi[/eluser]
[quote author="pickupman" date="1305405877"]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?[/quote]
i set up sendmail for using in host , but sendmail didn't work without smtp server Big Grin
about text messagge , Yahoo have not any problem with text mails , i only want use html email Smile
#8

[eluser]pickupman[/eluser]
Just double checked your message source. You don't have a valid html source. Try this:
Code:
$msg= '
&lt;html&gt;
&lt;head&gt;&lt;title>Your title&lt;/title&gt;&lt;/head>
&lt;body&gt;
  <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>
&lt;/body&gt;
&lt;/html&gt;
#9

[eluser]Ali Fattahi[/eluser]
[quote author="pickupman" date="1305407823"]Just double checked your message source. You don't have a valid html source. Try this:
Code:
$msg= '
&lt;html&gt;
&lt;head&gt;&lt;title>Your title&lt;/title&gt;&lt;/head>
&lt;body&gt;
  <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>
&lt;/body&gt;
&lt;/html&gt;
[/quote]

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
#10

[eluser]pickupman[/eluser]
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:
Code:
$config['smtp_host'] = 'mail.myisp.com';
$config['smtp_user'] = '[email protected]';
$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.
Code:
$config['protocol']  = 'smtp';
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
$config['smtp_port'] = '465';
$config['smtp_timeout'] = '30';
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = 'password';
$config['charset']  = 'utf-8';
$config['newline']  = "\r\n";

I use both locally on Windows using Wamp.




Theme © iAndrew 2016 - Forum software by © MyBB