SMTP Mail function failed

SMTP Mail function failed

by Farrukh Ikram -
Number of replies: 6

Hi guys,

i have just installed moodle 1.5.x, everything went well, except the mail function, i tried it both by leaving the SMTP information blank and by putting the SMTP information, by putting the information, i get the following error

[code]

 Warning: fputs(): supplied argument is not a valid stream resource in C:\Inetpub\wwwroot\izwbt\lib\phpmailer\class.smtp.php on line 146

Warning: fgets(): supplied argument is not a valid stream resource in C:\Inetpub\wwwroot\izwbt\lib\phpmailer\class.smtp.php on line 1025
ERROR: The following From address failed: <font color="#0000aa">myname@myco.parentco.com</font>

 
 

Tried to send you an email but failed!

[/code]

in the SMTP setting during installation, i put my setting like this:

SMTP host = sm-tp-host.myco.parentco.com
Login = ab45678
Pwd = mypassword

on this point, i just want to make one thing clear, that when we are setting up outlook accounts, we use only "sm-tp-host" and then everything is fine and my address comes as <font color="#0000aa">myname@myco.parentco.com</font>.

Can anyone help this noob please ??

Thanks in advance.

Average of ratings: -
In reply to Farrukh Ikram

Re: SMTP Mail function failed

by mohammed ali -
  we are on the same boat i guess ,and please tell me  how did you solve that problem .and need really urgent answer about it
 thanks .
 
In reply to Farrukh Ikram

Re: SMTP Mail function failed

by Steve Neufeld -
Had exactly the same problem.  Don't know if it is a one-off or not.  The MOODLE was working up until this point, then all of a sudden this error message appeared.  I'm running MOODLE version 1.5 on a web hosting site (Brinkster) in a Windows environment.  Any explanation of the cause and possible solution would be appreciated.
In reply to Farrukh Ikram

Re: SMTP Mail function failed

by Ruby M -
I think it's pretty safe to say that no SMTP server will ever accept an email address with html tags, specially font tags since they're so 1990's and non-web standards too wink.

Barring that, and regardless of whether your outlook works with the smtp server or not, have you ever tried using the just the mail function on your hosting? Use a test script like:

<?php
$to = "you@earth.net"; $subject = "test this"; $message = "sent";
if (mail($to, $subject, $message)) echo "success!";
?>

If that works, then there's something wrong with how Moodle was set up. If it doesn't then there's something wrong with your server's configuration.

Just a suggestion,
Ruby
In reply to Ruby M

Re: SMTP Mail function failed

by Hashantha Mendis -
the best way is to edit the php.ini and put the correct STMP settings you received from your host and leave the

moodle Server-> Email settings blank

change the support email address as the sender
In reply to Hashantha Mendis

Re: SMTP Mail function failed

by Richard Enison -
HM,

The post you replied to is almost two years old and RM is no longer enrolled. But for future reference, I think a much better solution is in Email settings. Especially on a shared host, where editing php.ini is, to say the least, problematic. Because you have to jump through all kinds of hoops like asking your host's tech support staff
  1. do you support .htaccess files?
  2. do you allow use of php_value and php_flag directives in them?
  3. do you support custom php.ini files?
  4. how does one create one?
  5. where does it need to be?
  6. do I need one in every directory?
  7. etc. etc. etc.
and hope for straight answers.

RLE