Welcome Guest, Not a member yet? Register   Sign In
Error message when using mail()
#1

[eluser]Robb__[/eluser]
I got a strange message after moving my site to a different server, it sounds bad. Did I choose the wrong host?
Quote:A PHP Error was encountered

Severity: Warning

Message: mail() [function.mail]: mail() - double newline in headers, possible injection, mail dropped

Filename: libraries/Email.php

Line Number: 1232
Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.

User-Agent: Code Igniter
Date: Thu, 18 Oct 2007 10:30:42 +0200
From: "Test"
Return-Path:
Reply-To: "[email protected]"
X-Sender: [email protected]
X-Mailer: Code Igniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_471719b231824"
This is a multi-part message in MIME format.
Your email application may not support this format.

--B_ALT_471719b231824
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
#2

[eluser]nirbhab[/eluser]
if you are working on localhost than you would have to configure your smtp in php.ini file and restart the server.
if you are working on domain provided by other servers, case is different,

in both the cases the mail script you are using must have the mail address same for senders mail address.

eg.
var $useragent = "CodeIgniter";
var $mailpath = "/usr/sbin/sendmail"; // Sendmail path
var $protocol = "mail"; // mail/sendmail/smtp
var $smtp_host = "mail.server.in"; // SMTP Server. Example: mail.earthlink.net
var $smtp_user = ""; // SMTP Username
var $smtp_pass = ""; // SMTP Password

is the Email.php file, you need to configure it to send mail, i suppose.

i think this might help you out.
#3

[eluser]Robb__[/eluser]
[quote author="nirbhab" date="1192715279"]if you are working on localhost than you would have to configure your smtp in php.ini file and restart the server.
if you are working on domain provided by other servers, case is different,

in both the cases the mail script you are using must have the mail address same for senders mail address.

eg.
var $useragent = "CodeIgniter";
var $mailpath = "/usr/sbin/sendmail"; // Sendmail path
var $protocol = "mail"; // mail/sendmail/smtp
var $smtp_host = "mail.server.in"; // SMTP Server. Example: mail.earthlink.net
var $smtp_user = ""; // SMTP Username
var $smtp_pass = ""; // SMTP Password

is the Email.php file, you need to configure it to send mail, i suppose.

i think this might help you out.[/quote]


This info is correct according to my server-provider

Quote:var $useragent = "Code Igniter";
var $smtp_host = "xyz"; // SMTP Server. Example: mail.earthlink.net
var $smtp_user = "myuser"; // SMTP Username
var $smtp_pass = "mypassw"; // SMTP Password
var $smtp_port = "25"; // SMTP Port
var $smtp_timeout = 5; // SMTP Timeout in seconds

This I'm not sure about:

Quote:var $mailpath = "/usr/sbin/sendmail"; // Sendmail path
var $protocol = "mail"; // mail/sendmail/smtp

How do I check this?
#4

[eluser]Robb__[/eluser]
This is my new (big) error message after configuring the email.php file
what could be wrong?

Quote:A PHP Error was encountered

Severity: Warning

Message: fsockopen() [function.fsockopen]: unable to connect to http://mail7.space2u.com/:25 (Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?)

Filename: libraries/Email.php

Line Number: 1342
A PHP Error was encountered

Severity: Warning

Message: fwrite(): supplied argument is not a valid stream resource

Filename: libraries/Email.php

Line Number: 1481
A PHP Error was encountered

Severity: Warning

Message: fgets(): supplied argument is not a valid stream resource

Filename: libraries/Email.php

Line Number: 1502
A PHP Error was encountered

Severity: Warning

Message: fwrite(): supplied argument is not a valid stream resource

Filename: libraries/Email.php

Line Number: 1481
A PHP Error was encountered

Severity: Warning

Message: fgets(): supplied argument is not a valid stream resource

Filename: libraries/Email.php

Line Number: 1502
A PHP Error was encountered

Severity: Warning

Message: fwrite(): supplied argument is not a valid stream resource

Filename: libraries/Email.php

Line Number: 1481
A PHP Error was encountered

Severity: Warning

Message: fgets(): supplied argument is not a valid stream resource

Filename: libraries/Email.php

Line Number: 1502
A PHP Error was encountered

Severity: Warning

Message: fwrite(): supplied argument is not a valid stream resource

Filename: libraries/Email.php

Line Number: 1481
A PHP Error was encountered

Severity: Warning

Message: fgets(): supplied argument is not a valid stream resource

Filename: libraries/Email.php

Line Number: 1502
A PHP Error was encountered

Severity: Warning

Message: fwrite(): supplied argument is not a valid stream resource

Filename: libraries/Email.php

Line Number: 1481
A PHP Error was encountered

Severity: Warning

Message: fwrite(): supplied argument is not a valid stream resource

Filename: libraries/Email.php

Line Number: 1481
A PHP Error was encountered

Severity: Warning

Message: fgets(): supplied argument is not a valid stream resource

Filename: libraries/Email.php

Line Number: 1502
The following SMTP error was encountered: 0 Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?
Unable to send data: AUTH LOGIN
Failed to send AUTH LOGIN command. Error:
Unable to send data: MAIL FROM:

from:

The following SMTP error was encountered:
Unable to send data: RCPT TO:

to:

The following SMTP error was encountered:
Unable to send data: DATA

data:

The following SMTP error was encountered:
Unable to send data: User-Agent: Code Igniter Date: Mon, 22 Oct 2007 21:56:48 +0200 From: "Test" Return-Path: To: [email protected] Subject: Pearl party booking request Reply-To: "[email protected]" X-Sender: [email protected] X-Mailer: Code Igniter X-Priority: 3 (Normal) Message-ID: <[email protected]> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="B_ALT_471d00800de5a" This is a multi-part message in MIME format. Your email application may not support this format. --B_ALT_471d00800de5a Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit ae er wants to book a meeting for a pearl party at er on the 2007,10,20. She/He also want's you to know that er --B_ALT_471d00800de5a Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted/printable ae er wants to book a meeting for a pearl party at er on the 2007,10,20.
She/He also want's you to know that er--B_ALT_471d00800de5a--
Unable to send data: .

The following SMTP error was encountered:
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.

User-Agent: Code Igniter
Date: Mon, 22 Oct 2007 21:56:48 +0200
From: "Test"
Return-Path:
To: [email protected]
Subject: Pearl party booking request
Reply-To: "[email protected]"
X-Sender: [email protected]
X-Mailer: Code Igniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0


Content-Type: multipart/alternative; boundary="B_ALT_471d00800de5a"
This is a multi-part message in MIME format.
Your email application may not support this format.

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

ae er wants to book a meeting for a pearl party at er on the 2007,10,20.
She/He also want's you to know that er


--B_ALT_471d00800de5a
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted/printable

ae er wants to book a meeting for a pearl party at er on the 2007,10,20.
She/He also want's you to know that er--B_ALT_471d00800de5a--
#5

[eluser]developer_rtpl[/eluser]
I got strange message when i am sending mail through CI
Quote:A PHP Error was encountered

Severity: Warning

Message: mail() [function.mail]: Bad parameters to mail() function, mail not sent.

Filename: libraries/Email.php

Line Number: 1519
Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.

User-Agent: CodeIgniter
Date: Mon, 29 Jun 2009 22:47:04 -0700
From: "CSSNinja"
Return-Path:
Reply-To: "[email protected]"
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_4a49a6d87341f"

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

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

Below this i am getting my email template. in plain/text and plain/html format

I am loading my email library using this code
Quote: $config['protocol'] = 'mail';
$config['wordwrap'] = FALSE;
$config['mailtype'] = 'html';
$this->load->library('email',$config)
#6

[eluser]MCrittenden[/eluser]
Any updates here? I'm getting the same errors as #3.
#7

[eluser]smilie[/eluser]
@MCrittenden:
If you receive same message as #3, then this is the clue:

Message: fsockopen() [function.fsockopen]: unable to connect to http://mail7.space2u.com/:25 (Unable to find the socket transport “http” - did you forget to enable it when you configured PHP?)

If you are trying this on your webhost server, there is a good chance that they have secured fsockopen function within PHP and do not allow it to connect remotely. Which would explain the problem :-)

Regards,
Smilie
#8

[eluser]MCrittenden[/eluser]
@smilie: Thanks! Figured it out, I was telling CI to use the wrong port. Changed smtp_port to 25 and all works as expected.




Theme © iAndrew 2016 - Forum software by © MyBB