Welcome Guest, Not a member yet? Register   Sign In
Email sending issue....
#1

[eluser]rafi_ccj[/eluser]
i am having problem in sending email ...
this is the code
<code>
function email_send() {
$to = '[email protected]';//$this->input->post('email');
$con = array(
'protocol' => 'smtp',
'smtp_host' => 'something',
'smtp_port' => 465,
'smtp_user' => '[email protected]',
'smtp_pass' => '123456'
);
$this->load->library('email', $con);
$this->email->set_newline("\r\n");
$this->email->from('[email protected]', 'ME');
$this->email->to($to);
$this->email->subject('Welcome to Gramweb');
$this->email->message('Congratulation! Your account has successfully been created. Now Cheers!!!');
if ($this->email->send()) {
echo 'Email sent successful!.';
} else {
show_error($this->email->print_debugger());
}
}
</code>


but i am having this problem.....
<code>
A PHP Error was encountered

Severity: Warning

Message: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()

Filename: libraries/Email.php

Line Number: 1553
</code>


give me a solution!!!
#2

[eluser]InsiteFX[/eluser]
Your answer is in the Error!

Setup your php.ini file to use smtp
#3

[eluser]rafi_ccj[/eluser]
can you please tell me how to setup the php.ini file to send email please? i am new here!
#4

[eluser]Jason Stanley[/eluser]
Google it.

When you upload your site to a web server it will probably magically start working as your web server will be configured correctly. As you are working on your computer and do not have a mail server on your computer it isn't working.
#5

[eluser]rafi_ccj[/eluser]
i did google it....and tried what is said there...that doesn't help me Sad
can you please anyone help me???
#6

[eluser]Jason Stanley[/eluser]
What are you using? XAMPP / MAMP / Self configured LAMP install?
#7

[eluser]InsiteFX[/eluser]
Example - php.ini
Code:
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = smtp.comcast.net
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = postmaster@localhost

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = On

; Log all mail() calls including the full path of the script, line #, to address and headers
mail.log = "C:\xampp\php\logs\php_mail.log"

Make sure the mod_ssl is installed!




Theme © iAndrew 2016 - Forum software by © MyBB