Recent Topics

1 Sep 10, 2006 15:58    

Hi:

When the "Check this to allow receiving emails through a message form" is enabled in profile and then when using the email message form, it does not send mail using smtp on windows 2003 servers.

Mail is sent however, when using the comment form and when new users register.

Why does the b2evolution "leave comment" email function work but not the email message function on Windows 2003 servers?

I have been configuring and using mail functions on Windows servers for a few years and have never had issues - my php.ini is correctly configured because the "leave comment" email function works.

Any suggestions?

2 Sep 10, 2006 19:10

Do you get the 'Your message has been sent as email to the user.' success message after sending?

3 Sep 10, 2006 19:21

yes, and when I set the debug mode to "2" in _advanced.php I get the following error report when using the email message form:

(note: substitutions for email addresses were made below)

Backtrace:
debug_die( "Sending mail from «admin <clicks@mymail.net>&raq..." )
File: C:\Inetpub\wwwroot\mysite\inc\_misc\_misc.funcs.php:2067
send_mail( "admin <myAdmin@mymail.net>", "Re: Second post", "sdfgsdgdfgdsg-- This message was sent via the messaging syste...", "admin <myAdminAcct@mymail.net>" )
File: C:\Inetpub\wwwroot\mysite\htsrv\message_send.php:234
Ignored last: 1

Again, the send comment function is sending comment related info via email without issue.

Clicks

4 Sep 10, 2006 20:00

"send comment" uses the same function (send_mail()).

It would be more instering what's above the "Backtrace". But I think it says "FAILED"?!

I think you have to digg into _misc.funcs.php's send_mail() method and experiment, what's the part which causes it to fail.

I'll correct the places, where the return code of send_mail() does not get used.. (it should not say that the message had been sent) :/

5 Sep 10, 2006 20:04

Sorry, yes, this is the: Additional information about this error:

Sending mail from «admin <me@mymail.net>» to «admin <me@mymail.net>», Subject «Re: Important information» FAILED

Clicks

6 Sep 10, 2006 20:33

Maybe it may help already to set error_reporting to E_ALL and display_errors to "on". For $debug > 1 you should see any notices or warnings with the call to mail().

7 Sep 10, 2006 20:42

I think you just lost me.

set error_reporting to E_ALL and display_errors to "on". For $debug > 1 you should see any notices or warnings with the call to mail().

Where and how do I do this?

Clicks

9 Sep 10, 2006 21:10

I used ini_set in /conf/_basic_config.php - no change.

Here's the warning messge that appears at the very top of the display errors page:

Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in C:\Inetpub\wwwroot\mysite\inc\_misc\_misc.funcs.php on line 2067

Thanks for your help.

Clicks.

10 Sep 10, 2006 21:46

What "no change"? There is actually the Warning..!?!

Or has it been there before? If so, you should have told us, of course..

Can you please try the following code:


<?php
error_reporting(E_ALL);
ini_set('display_errors', 'on');
$email = 'foo@example.com';

$i = 0;
foreach( array( $email, "test <$email>", "\"test\" <$email>" ) as $e )
{
  $i++;
  if( ! mail( $e, "Test $i", 'Test' ) )
  {
     echo "Number #$i ($e) failed.\n<br />";
  }
}
echo "end.\n";
?>


(put that into a single file, change the $email to yours and call it through the browser).

Which ones fail?

11 Sep 10, 2006 21:53

There is actually the Warning..!?!

Yes, but the warning only appeared after ini_set

I will try the code.

Thank you.

Clicks

12 Sep 10, 2006 21:57

It renders a blank screen

13 Sep 10, 2006 22:03

You've said "no change", but the Warning (as expected/hoped appeared). That confused me, because there _was_ a change.

Anyway, there should be not problem with the other email address/format then, if you've not obfuscated it too much, because

Sending mail from «admin <me@mymail.net>» to «admin <me@mymail.net>», Subject «Re: Important information» FAILED

"admin <me@mymail.net>" is like the second example in the test you've just tried..

Can you send a mail to the address that fails, as stated in the error/failed-message, through an email client?

14 Sep 10, 2006 22:23

Can you send a mail to the address that fails, as stated in the error/failed-message, through an email client?

Yes.

Sorry if I confused you. I will try to work with this a bit more to see what I can find out.

Thanks.

Clicks.

15 Sep 10, 2006 23:01

Just to be sure, add


error_reporting(E_ALL);
ini_set('display_errors', 'on');


at the top of the test script.. there may be a fatal error and therefor the blank page. I'll update the script above, also putting an "ok." at the end.


Form is loading...