Hi,
I have installed osticket under MS Server 2003 x64, windows IIS SMTP, & IIS 6. I have got everything running just fine except I am having problems sending emails. When I create a new ticket I keep getting this error:
PHP Warning: mail() : SMTP server response: 501 5.5.4 Invalid Address in C:\Program Files (x86)\osticket\osticket_1.6.rc5\upload\include\pear\Mail\mail.php on line 137
I am however able to send mail via php mail(). For example my test.php below works:
<?php
$to = "support@mydomain.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "support@mydomain.com";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
In my php.ini file I have this:
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
;sendmail_from = me@example.com
Log from SMTP server
2009-09-21 15 10.10.10.102 miami SMTPSVC1 MIAMI 10.10.10.102 0 HELO - +miami 250 0 42 10 0 SMTP - - - -
2009-09-21 15 10.10.10.102 miami SMTPSVC1 MIAMI 10.10.10.102 0 MAIL - +FROM:<"support@mydomain.com"<support@mydomain.com>> 501 0 27 62 0 SMTP - - - -
2009-09-21 15 10.10.10.102 miami SMTPSVC1 MIAMI 10.10.10.102 0 QUIT - miami 240 0 64 4 0 SMTP - - - -
I think this may have something to do with the headers attached to the email? When I change this line:
if (empty($this->_params) || ini_get('safe_mode')) {
$result = mail($recipients, $subject, $body, $text_headers);
to this:
if (empty($this->_params) || ini_get('safe_mode')) {
$from = "me@mydomain.com";
$headers = "From: $from";
$result = mail($recipients, $subject, $body, $headers);
this will work but the message has weird spacing that messes it up.
Any ideas?
Thanks!
Luis