I am running MODX on a windows server. My mail provider requires me to perform SMTP authentication.
I have the following code in a test snippet:
<?php
//$to = "XXXXX@WEBSITE_HOSTED_WITH_ARVIXE.com";
$to = "
[email protected]";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "
[email protected]";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
When I run the above with $to = "XXXXX@WEBSITE_HOSTED_WITH_ARVIXE.com"; it works perfectly.
When I run with $to = "
[email protected]";
I get:
« MODX Parse Error »
MODX encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
PHP error debug
Error : mail() [function.mail]: SMTP server response: 530 SMTP authentication is required.
ErrorType[num] : WARNING[2]
File : C:\HostingSpaces\ctwhite\ctwhitetailassociation.com\wwwroot\manager\includes\document.parser.class.inc.php(828) : eval()'d code
Line : 9
Basic info
REQUEST_URI : /index.php?id=62
Resource : [62]Testing
Current Snippet : testmail
Referer :
User Agent : Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36
IP : 71.235.120.9
Benchmarks
MySQL : 0.0000 s (8 Requests)
PHP : 0.1248 s
Total : 0.1248 s
Memory : 2.402961730957 mb
Backtrace
1 DocumentParser->executeParser()
index.php on line 136
2 DocumentParser->prepareResponse()
manager/includes/document.parser.class.inc.php on line 1294
3 DocumentParser->outputContent()
manager/includes/document.parser.class.inc.php on line 1385
4 DocumentParser->parseDocumentSource()
manager/includes/document.parser.class.inc.php on line 491
5 DocumentParser->evalSnippets()
manager/includes/document.parser.class.inc.php on line 1186
6 DocumentParser->_get_snip_result()
manager/includes/document.parser.class.inc.php on line 874
7 DocumentParser->evalSnippet()
manager/includes/document.parser.class.inc.php on line 956
8 eval()
manager/includes/document.parser.class.inc.php on line 828
9 mail()
manager/includes/document.parser.class.inc.php(828) : eval()'d code on line 9
I know I have to modify the underlying SMTP classes and add the host/user/password but not sure where.
I get the same error when I try to use the web snippet weblogin on this call:
// Send new password to the user
function webLoginSendNewPassword($email,$uid,$pwd,$ufn){
Any help would be appreciated.
Thanks in advance.