Welcome Guest, Not a member yet? Register   Sign In
Email Attachment Problem
#11

[eluser]rogerwaldrup[/eluser]
There's some problem in coding.. check it out
#12

[eluser]Synchy[/eluser]
I've changed the coding to 'iso-8859-1', it didn't work. But which protocol should be used because as I said before only the standard 'mail' protocol works on my localhost (xampp) and if it's necessary to use 'smtp' or 'sendmail', how can I configure my xampp so I can use it? Because I need this to work before I deploy it on a proper webhost.
#13

[eluser]InsiteFX[/eluser]
I use this tool for testing emails.
Test Mail Server Tool

InsiteFX
#14

[eluser]Synchy[/eluser]
Yes might try that later, but I want to know first which of the 3 protocols I should use, and how they can be configured to use on a localhost (xampp)?
#15

[eluser]InsiteFX[/eluser]
Usally on your localhost and live server the protocol will be SMTP

The tool above I mentioned to you will setup everything for you,
use SMTP port 25 on your localhost and it maybe the same on your
live server but some hosting companies change it to a diffeent port.

InsiteFX
#16

[eluser]Synchy[/eluser]
I've used the tool you suggested and now when I send a mail with de 'smtp' protocol it gives the following error:

Code:
Fatal error: Uncaught exception 'PDFlibException' with message 'fsockopen()
[<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to localhost:25 (A
connection attempt failed because the connected party did not properly respond after a
period of time, or established connection failed because connected host has failed to
respond. )' in C:\xampp\htdocs\websites\helios_studio\system\libraries\Email.php:1652
Stack trace: #0 C:\xampp\htdocs\websites\helios_studio\system\libraries\Email.php(1652):
fsockopen('localhost', '25', 10060, 'A connection at...', 5) #1
C:\xampp\htdocs\websites\helios_studio\system\libraries\Email.php(1584): CI_Email-
>_smtp_connect() #2 C:\xampp\htdocs\websites\helios_studio\system\libraries\Email.php
(1481): CI_Email->_send_with_smtp() #3
C:\xampp\htdocs\websites\helios_studio\system\libraries\Email.php(1350): CI_Email-
>_spool_email() #4
C:\xampp\htdocs\websites\helios_studio\system\application\controllers\standard.php(195):
CI_Email->send() #5 C:\xampp\htdocs\websites\helios_studio\s in
C:\xampp\htdocs\websites\helios_studio\system\libraries\Email.php on line 1652

And this is the updated code for sending the mail:

Code:
function send_order_mail($to, $attach) {
    $config['wordwrap'] = FALSE;
    $config['mailtype'] = 'text';
    $config['charset'] = 'iso-8859-1';
    $config['protocol'] = 'smtp';
    $config['smtp_host'] = 'localhost';

    $this->email->initialize($config);
    $this->email->from('[email protected]', 'Helios Studio');
    $this->email->to($to);
    //$this->email->bcc('[email protected]');
    
    $this->email->attach($attach);
    $this->email->subject('Bestelling');
    $this->email->message('Dit is je factuur');

    $this->email->send();
    echo $this->email->print_debugger();
}
#17

[eluser]Synchy[/eluser]
It finally works, I had to use none of the programs but tried to use the smtp-server of gmail, I've tried it before but never worked and apparently I had to add:

Code:
$this->email->set_newline("\r\n");

On the top of the e-mail function to be able to connect to the gmail smtp. I'm guessing this is a bug then in CI? Anyway thanks for your help and patience.




Theme © iAndrew 2016 - Forum software by © MyBB