[SOLVED] Email Mystery

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
|maxx|
Forum Newbie
Posts: 4
Joined: Thu Jun 24, 2004 9:45 am
Location: Houston
Contact:

Email Mystery

Post by |maxx| »

:?
Im having trouble sending emails to addresses outside my domain...
Whenever I use mail(); it will send emails to any account @ourdomain.com just fine, but any outside addresses get rejected.

My email server is win32 and the php.ini settings are as follows:
____________________________________________________
[mail function]
; For Win32 only.
SMTP = 183.xxx.0.2; for Win32 only
sendmail_from= Maxx@ourdomain.com; for Win32 only

; For Win32 only.
sendmail_from = Maxx@ourdomain.com

; For Unix only. You may supply arguments as well (default: "sendmail -
t -i").
;sendmail_path = \sendmail -t -i
____________________________________________________


Im pretty sure the problem is in this (part of returned email)

__________________________________
Illegal-Object: S
Return-path: <>
^-expected word
__________________________________

...but I dont know what i can do to fix this... please help!

thank you!
User avatar
launchcode
Forum Contributor
Posts: 401
Joined: Tue May 11, 2004 7:32 pm
Location: UK
Contact:

Post by launchcode »

The problem is in your PHP code, not your INI file - post the part of it that sends the email.
|maxx|
Forum Newbie
Posts: 4
Joined: Thu Jun 24, 2004 9:45 am
Location: Houston
Contact:

Post by |maxx| »

Code: Select all

<?php
function send_mail($myname, $myemail, $contactname, $contactemail, $subject, $message) &#123;
  $headers="";
  $headers .= "MIME-Version: 1.0\n";
  $headers .= "Content-type: text/plain; charset=iso-8859-1\n";
  $headers .= "X-Priority: 1\n";
  $headers .= "X-MSMail-Priority: High\n";
  $headers .= "X-Mailer: php\n";
  $headers .= "From: "".$myname."" <".$myemail.">\n";
  return(mail(""".$contactname."" <".$contactemail.">", $subject, $message, $headers));
&#125;


if (send_mail("Company", "maxx@ourdomain.com", "Customer", "maxx@vwsmail.com", "This is a test", "This is a test\nOne two three four\nBlah blah blah\nThis is a test!")) &#123;
  print "SENT!<br>";
&#125; else &#123;
  print "FAILED!<br>";
&#125; 
?>
|maxx|
Forum Newbie
Posts: 4
Joined: Thu Jun 24, 2004 9:45 am
Location: Houston
Contact:

Post by |maxx| »

I dont really think its the code, this problem seems very specific.... and I got the code from php.net so i doubt thats the problem
|maxx|
Forum Newbie
Posts: 4
Joined: Thu Jun 24, 2004 9:45 am
Location: Houston
Contact:

[SOLVED]

Post by |maxx| »

Ok.. we resolved the problem by routing the email outside of our firewall and groupwise.... so if anyone is having this problem (which no one else apparently is) this is how you fix it.... or go around it at least...
Post Reply