Welcome Guest, Not a member yet? Register   Sign In
email.php config content displaying on web page
#1

[eluser]ebohling[/eluser]
newbie question 73: why would the email.php file contents be displaying on my web page? it doesn't display all the time, only when an email is sent. no debugger/profiler statements are present. email is being sent fine, just the file contents are being displayed at the top of the web page.

ideas?
#2

[eluser]Thorpe Obazee[/eluser]
You probably echo-ed it somewhere.
#3

[eluser]ebohling[/eluser]
that was my first thought, but there are absolutely NO ECHO statements in my code...only in CI...but those are mainly in the error handling code and this is NOT occurring during an error, rather a successfully sent email.
#4

[eluser]Thorpe Obazee[/eluser]
Could you show it?
#5

[eluser]ebohling[/eluser]
additional info:

email.php (works but displays on webpage)
=============================
Code:
$config['protocol'] = 'smtp';
//$config['mailpath'] = '/usr/sbin/sendmail';
$config['wordwrap'] = TRUE;
$config['smtp_host'] = 'ssl://smtp.gmail.com';
$config['smtp_user'] = 'myuser';
$config['smtp_pass'] = 'mypassword';
$config['smtp_port'] = '587';
$config['newline'] = "\r\n";
$config['smtp_timeout'] = '5'; // in seconds
$config['mailtype'] = 'text'; // or html
$config['validation'] = TRUE; // bool whether to validate email or not

WEBPAGE (display this text at the very top)
==================================
$config['protocol'] = 'smtp'; //$config['mailpath'] = '/usr/sbin/sendmail'; $config['wordwrap'] = TRUE; $config['smtp_host'] = 'ssl://smtp.gmail.com'; $config['smtp_user'] = 'myuser'; $config['smtp_pass'] = 'mypassword'; $config['smtp_port'] = '587'; $config['newline'] = "\r\n"; $config['smtp_timeout'] = '5'; // in seconds $config['mailtype'] = 'text'; // or html $config['validation'] = TRUE; // bool whether to validate email or not /* End of file email.php */ /* Location: ./system/application/config/email.php */

email.php (does not work; throws all sorts of errors)
===================================
Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

$config['protocol'] = 'smtp';
//$config['mailpath'] = '/usr/sbin/sendmail';
$config['wordwrap'] = TRUE;
$config['smtp_host'] = 'ssl://smtp.gmail.com';
$config['smtp_user'] = 'myuser';
$config['smtp_pass'] = 'mypassword';
$config['smtp_port'] = '587';
$config['newline'] = "\r\n";
$config['smtp_timeout'] = '5'; // in seconds
$config['mailtype'] = 'text'; // or html
$config['validation'] = TRUE; // bool whether to validate email or not

/* End of file email.php */
/* Location: ./system/application/config/email.php */

ERRORS
=========

A PHP Error was encountered
Severity: Warning
Message: fsockopen() [function.fsockopen]: SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
Filename: libraries/Email.php
Line Number: 1646

A PHP Error was encountered
Severity: Warning
Message: fsockopen() [function.fsockopen]: Failed to enable crypto
Filename: libraries/Email.php
Line Number: 1646

A PHP Error was encountered
Severity: Warning
Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:587 (Unknown error)
Filename: libraries/Email.php
Line Number: 1646

A PHP Error was encountered
Severity: Warning
Message: fwrite(): supplied argument is not a valid stream resource
Filename: libraries/Email.php
Line Number: 1789

A PHP Error was encountered
Severity: Warning
Message: fgets(): supplied argument is not a valid stream resource
Filename: libraries/Email.php
Line Number: 1812

A PHP Error was encountered
Severity: Warning
Message: fwrite(): supplied argument is not a valid stream resource
Filename: libraries/Email.php
Line Number: 1789

A PHP Error was encountered
Severity: Warning
Message: fgets(): supplied argument is not a valid stream resource
Filename: libraries/Email.php
Line Number: 1812

A PHP Error was encountered
Severity: Warning
Message: fwrite(): supplied argument is not a valid stream resource
Filename: libraries/Email.php
Line Number: 1789

A PHP Error was encountered
Severity: Warning
Message: fgets(): supplied argument is not a valid stream resource
Filename: libraries/Email.php
Line Number: 1812

A PHP Error was encountered
Severity: Warning
Message: fwrite(): supplied argument is not a valid stream resource
Filename: libraries/Email.php
Line Number: 1789

A PHP Error was encountered
Severity: Warning
Message: fgets(): supplied argument is not a valid stream resource
Filename: libraries/Email.php
Line Number: 1812

A PHP Error was encountered
Severity: Warning
Message: fwrite(): supplied argument is not a valid stream resource
Filename: libraries/Email.php
Line Number: 1789

A PHP Error was encountered
Severity: Warning
Message: fwrite(): supplied argument is not a valid stream resource
Filename: libraries/Email.php
Line Number: 1789

A PHP Error was encountered
Severity: Warning
Message: fgets(): supplied argument is not a valid stream resource
Filename: libraries/Email.php
Line Number: 1812
#6

[eluser]ebohling[/eluser]
anyone this morning have any ideas on my situation?
#7

[eluser]patrickpopowicz[/eluser]
Have you tried port 465 instead of 587?
#8

[eluser]ebohling[/eluser]
you got to be kidding me...i originally had 465, but changed it for some reason so didn't think to try it again. that was it. using the (obviously correct) 2nd email.php code above with port 465 worked as expected. thanks!




Theme © iAndrew 2016 - Forum software by © MyBB