• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
my email has no message and attachment

Hello every body,
I run into a sending email issue. My recipient can receive the email, but only the upper part of the mail, from, to and subject.
There is no message, no attachment at all.

However, it was not the case before, at the beginning of my running test, everybody can receive a whole page of email. Suddenly, recipients can only get the from, to and the subject parts but no message or attachment!

I wonder whats happening? I am working on the same computer and the same localhost apache setup. PHP Version 5.3.8. Can any one of you help.

Here is my config.php and below that is my emial send out function, please take a look and help.

$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
$config['smtp_port'] = 465;
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = '3456';
$config['mailtype'] = 'html';
$config['charset'] = 'iso-8859-1';

public function send(){


$this->email->from('[email protected]', 'Art H');
$this->email->to([email protected]);
$this->email->subject('A short subject');
$this->email->message('Message for you today');
$path = $this->config->item('server_root');
$file = $path . '/day1/attachments/somenote.txt';





You $config parameters should be in the function sending the email.


Thanks for your suggestion. I did that but it makes no big different.

It seems that it is the attach cause the trouble. When I REM out those 2lines of attachment than I have an email with message.

And I tried to go through my own ISP's smtp, the result were the same. So I think might it be something within codeigniter framework

Your assigning $path but it does not show in your code.
$file = $path . '/day1/attachments/somenote.txt';
// maybe it should be, you do not use a full url.
$file = '/day1/attachments/somenote.txt';

Check and see if your getting any errors.

Thanks again insiteFX, the issue has been solved by accident.

As we can see,
$path = $this->config->item(‘server_root’); [defined in the config.php]

The 'server_root' really gives you up to the server's root! It is so wonderful.

And do you know what? My project is in a project folder within root, and day1 is within that project folder, so the following snippet
$file = $path . ‘/day1/attachments/somenote.txt’; is missing a folder in front of day1!!!!

This is why I said the email suddenly doesn't work properly, because before I moved email file into a project folder it is bared under the root!

Any way there is not an issue, codes were perfect.

Thanks a lot for your help.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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