smtp settings

Status
Not open for further replies.

chart3

New Member
Messages
1
Reaction score
0
Points
0
I'm using a php script that allows me to manually email to my small group of clients. The script reports that the email has been sent successfully, however the email never arrives to the client's inbox or spam box. I've tried using x10hosting's smtp settings both with and without my cpanel username and password. What information should I input into:

//////////////////////////////////////////////////////////////////
// SMTP EMAIL SETTINGS
//////////////////////////////////////////////////////////////////
define('SMTP_HOSTNAME', 'localhost');
define('SMTP_PORT', 25);
define('SMTP_USERNAME', '');
define('SMTP_PASSWORD', '');



Does there need to be a quote around the port number, 25? Do I need to do anything in cpanel to fix this problem? (I've already created an email username and password to identically match my cpanel username and password, but that didn't work either.)

I've read through other forum threads here for a solution, but I still have the same problem. Can anyone help?



Thanks



edit

I also tried using the following settings:

//////////////////////////////////////////////////////////////////
// SMTP EMAIL SETTINGS
//////////////////////////////////////////////////////////////////
define('SMTP_HOSTNAME', 'mail.protattooremoval.x10hosting.com');
define('SMTP_PORT', 25);

, but I get this error message:

SMTP Connection Failed: The SMTP connection failed to start [mail.protattooremoval.x10hosting.com:25]: fsockopen returned Error Number 110 and Error String 'Connection timed out'
 
Last edited:

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Does there need to be a quote around the port number, 25?

No; because of type juggling, PHP will generally convert between numeric and string data as needed.

More details would be helpful. How are you sending mail? Most importantly, how is it failing? Were there any error messages from the original setup?

If you're using PHP's mail function, a comment in the documentation suggests setting the sendmail_from configuration variable:
Code:
ini_set('sendmail_from', 'me@domain.com');

Also, try communicating with the mail server by hand to see what errors you might be getting. The following Perl script can generate the text to send to the server:
Code:
#!/usr/bin/env perl
use MIME::Base64;
$sender='chart3@protattooremoval.x10hosting.com';
$receiver='chart3@protattooremoval.x10hosting.com';
$user = encode_base64('username', '');
$pw = encode_base64('password', '');
print <<EOF;
EHLO $client
AUTH LOGIN
$user
$pw
MAIL FROM: <$sender>
RCPT TO: <$receiver>
DATA
Subject: test e-mail

Test.
.
QUIT
EOF
Telnet to port 25 of the mailserver and send the result of the above script.

For details on SMTP communications, Technoids has a short article on the SMTP AUTH mechanism (the "AUTH LOGIN\n$user\n$pw" lines). There are plenty of sample SMTP sessions online.
 
Status
Not open for further replies.
Top