News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

E-Mail not working (yes I have searched the forums)

Started by harrat, June 03, 2008, 01:17:06 AM

Previous topic - Next topic

harrat

I have looked ALOT through the forums in the last few days trying to figure out what is happening and I am unable to resolve the issue, I assume it may be a 2.0 bug but do not know how to verify beyond what I am doing. Now for some background.....

Host is 1and1.com [nofollow]

I am not receiving ANY mail notifications from the boards. When set to use the default php mailer I do not receive any error. when setting the mail smtp (smtp.1and1.com) I receive the following error...

Ran into problems sending Mail. Error: 504 LOGIN mechanism not supported


If I remove the SMTP login and password as suggested in some posts, I do not receive any error logs.

At this point I decided to check to ensure my php mail was working properly, So I found this thread http://www.simplemachines.org/community/index.php?topic=231137.0  with a script from greyknight17 that tests the mailer function. (in conjunction with SMF settings I believe)

Heres that script

<?php
// Your email address
$email '[email protected]';

// Tell us Everything..
error_reporting(E_ALL);

// Start this sucker..
DoTests();

function 
DoTests()
{
// Global some stuff.
global $scripturl$modSettings$email$txt$context$webmaster_email$mbname;

// How many tests?
$tests 7;

// We are not 1337 haxors..
define('SMF'1);

// Settings, SSI (for user info), Language files, Subs (For functions SMF Email needs), Subs-Posts (For emailing with SMF)
require_once('Settings.php');
require_once('SSI.php');
require_once($boarddir '/Themes/default/languages/index.english.php');
require_once($sourcedir '/Subs.php');
require_once($sourcedir '/Subs-Post.php');

if(isset($_REQUEST['do']))
$test = (int) $_REQUEST['do'];
if(isset($test) && function_exists('smf_email_test' $test))
{
$eFunc 'smf_email_test' $test;
return $eFunc();
}

// Our counter.
$i 0;
while($i $tests)
{
++$i;

$eFunc 'smf_email_test' $i;
$eFunc();
}

echo ' Now Check your inbox, spam or whereever for your mail';
}

// Test: 1; Is email just plain broke?
function smf_email_test1()
{
global $email;

echo 'Is email itself a problem?<br />First Test Results: ';
if(mail($email'First Test in testing''If you received this then the test passed'))
echo 'We sent the email<br />';
else
echo 'We failed to send the email<br />';
}

// Test: 2; Are any strings a problem??
function smf_email_test2()
{
global $email;

$subject 'Second Test';
$msg 'If you received this then the test passed';

echo 'Are any strings a problem?<br />Second Test Results: ';
if(mail($email$subject$msg))
echo 'We sent the email<br />';
else
echo 'We failed to send the email<br />';
}

// Test: 3; Are SMF text strings a problem??
function smf_email_test3()
{
global $email$txt;

echo 'Are SMF Text strings a problem?<br />Third Test Results: ';
if(mail($email, ('Third Test:' $txt[106]), ($txt[152] . ' ' $txt[164] . ' ' $txt[153] . 'If you received this then the test passed')))
echo 'We sent the email<br />';
else
echo 'We failed to send the email<br />';
}

// Test: 4; Email allowed to be sent from your forum name?
function smf_email_test4()
{
global $email$txt$context$mbname;

echo 'Are we allowed to send with your forum name ('$mbname') ?<br />Fourth Test Results: ';
if(sendmail($email'Fourth Test:''If you received this then the test passed'$mbname))
echo 'We sent the email<br />';
else
echo 'We failed to send the email<br />';
}

// Test: 5; Email allowed to be sent from webmaster_email?
function smf_email_test5()
{
global $email$txt$context$webmaster_email;

echo 'Are we allowed to send with webmaster email ('$webmaster_email') ?<br />Fifth Test Results: ';
if(sendmail($email'Fifth Test''If you received this then the test passed'$webmaster_email))
echo 'We sent the email<br />';
else
echo 'We failed to send the email<br />';
}

// Test: 6; Email allowed to be sent from your domain?
function smf_email_test6()
{
global $email$txt$context$webmaster_email;

// Borrowed, stripped, and edited from No Reply Emails.
$from 'noreply@' str_replace('www.'''$_SERVER['HTTP_HOST']);

echo 'Are we allowed to send from your domain?<br />Sixth Test Results: ';
if(sendmail($email'Sixth Test''If you received this then the test passed'$from))
echo 'We sent the email<br />';
else
echo 'We failed to send the email<br />';
}

// Test: 7; HTML allowed?
function smf_email_test7()
{
global $email$txt$context$webmaster_email;

echo 'Are we allowed to Send with HTML?<br />Seventh Test Results: ';
if(sendmail($email'Seventh Test''If you received this then the test passed'$webmaster_emailnullnulltrue))
echo 'We sent the email<br />';
else
echo 'We failed to send the email<br />';
}
?>



This is where it gets interesting. If I use my gmail account in the above, I get all 7 test e-mails properly, however the script does throw the following errors...

Is email itself a problem?
First Test Results: We sent the email
Are any strings a problem?
Second Test Results: We sent the email
Are SMF Text strings a problem?
Third Test Results:
Notice: Undefined offset: 106 in /homepages/9/d240703553/htdocs/forum/email.php on line 83

Notice: Undefined offset: 152 in /homepages/9/d240703553/htdocs/forum/email.php on line 83

Notice: Undefined offset: 164 in /homepages/9/d240703553/htdocs/forum/email.php on line 83

Notice: Undefined offset: 153 in /homepages/9/d240703553/htdocs/forum/email.php on line 83
We sent the email
Are we allowed to send with your forum name (EvE-Bot) ?
Fourth Test Results: We sent the email
Are we allowed to send with webmaster email ([email protected]) ?
Fifth Test Results: We sent the email
Are we allowed to send from your domain?
Sixth Test Results: We sent the email
Are we allowed to Send with HTML?
Seventh Test Results: We sent the email
Now Check your inbox, spam or whereever for your mail


HOWEVER if I send to the [email protected] address, which matches the forum domain, I still get the same output but receive none of the 7 mails I previously got with my gmail address.

So the next thing I did was install the 1.x forum in a subdomain to test the phpmailer, lo and behold it works properly. Although 1.X version of the forum is great I would really prefer to be using 2.X versions. Any help or input would be greatly appreciated.

Thanks in advance.


migrod

Have you tried to simply erase the username and password?
I worked fine for me this way.  ;)
(By the way I have 1.1.5 installed)
No íntimo de cada cavalo, há sempre um burro por descobrir...

harrat

Quote from: migrod on June 03, 2008, 10:05:21 PM
Have you tried to simply erase the username and password?
I worked fine for me this way.  ;)
(By the way I have 1.1.5 installed)

Indeed I did. I ended up having to wipe the forum completely, reinstall and then worked, thansk for the help.

Oldiesmann

#3
1and1 might support another method of authentication called "pop before smtp". This method requires you to login to the POP server (the one that actually downloads the email) before connecting to the SMTP server. SMF does actually support this, though there isn't any interface for it yet.

Can you try this?

First, run this query in phpMyAdmin:

UPDATE smf_settings
SET value = '2'
WHERE variable = 'mail_type';


Then fill in the SMTP info in your admin center.

After that, try sending a newsletter to yourself and see if it works.
Michael Eshom
Christian Metal Fans

harrat

I tried this on my new install and it did not work, I get the same error message as posted orginally when trying to send via smtp.

Rumbaar

Well the errors you get is due to the fact the $txt[] refer to 1.1.* strings that have been changing in 2.*.  Now not sure if that will affect the test.

Now the fact you say you get the same results for each test, but get it from gmail and not your own would indicate to me that the problem is the SMTP server your host is using.  Now I'm unsure how to test this, is that information stored in your own server logs?  Are you able to contact you host to ask them if they can offer some logs or indication of error at the SMTP level?
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Advertisement: