Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ever had this issue with an email script

Status
Not open for further replies.

deecee

Technical User
Aug 25, 2001
1,678
US
Ok here goes -- I have an email script (php) and it works and it will send to pretty much any email address! Except the one i need it to. IT will NOT send to my corporate email address but will go to my personal hotmail one! Ever seen this before? there is nothing i can do but what the @#%@#%%$&#^*#$^

<signature>
sometime you just gotta say &quot;WHAT THE @#*% !!&quot;
</signature>
 
does the corporate email address get filtered through a firewall? I know mine does and drives me %&(#!@&# nuts, along with a few other member here that email me regularly. [sad]

____________________________________________________
[sub]Python????? The other programming language you never thought of!
thread333-584700[/sub]
onpnt2.gif
 
yes it does. but i dont see why the firewall would prevent this. Cuz i have even tried sending this email to another email address and forwarding but even that wont work!

<signature>
sometime you just gotta say &quot;WHAT THE @#*% !!&quot;
</signature>
 
hmm.. that's the only reasoning I can think of. I would contact operations and see if the email is stuck or has been blocked in case that is the problem. I've seen emails get blocked on ours for absolutely no reasoning. The log should show if it has been blocked. Sometimes it can be the subject line and or any hard value that is being sent.

sorry couldn't help further

____________________________________________________
[sub]Python????? The other programming language you never thought of!
thread333-584700[/sub]
onpnt2.gif
 
Decee, I have found that this often occurs if the from field in your PHP does not contain a valid email id. When I say valid, I mean syntax-wise.

Clive
 
explain...because there is an email field that is the sending email in the form. here below is my script

Code:
<? if (!isset($email)){
     header(&quot;Location: [URL unfurl="true"]http://www.companysite.com/register.php&quot;);[/URL] 
	 }
	 
	 else {
	 
    $msg = &quot;MR/MRS:\t$mr\n&quot;;
	$msg .= &quot;First Name:\t$first\n&quot;;
    $msg .= &quot;Last Name:\t$last\n&quot;;
    $msg .= &quot;Middle Initial:\t$middle\n&quot;;
	$msg .= &quot;JR/PHD/ETC:\t$jr\n&quot;;
	$msg .= &quot;Email:\t$email\n&quot;;
    $msg .= &quot;Phone Number:\t$phone\n&quot;;
    $msg .= &quot;Fax:\t$fax\n&quot;;
	$msg .= &quot;Title:\t$title\n&quot;;
    $msg .= &quot;Company:\t$company\n&quot;;
    $msg .= &quot;Street1:\t$street1\n&quot;;
    $msg .= &quot;Street2:\t$street2\n&quot;;
    $msg .= &quot;City:\t$city\n&quot;;
    $msg .= &quot;State:\t$state\n&quot;;
    $msg .= &quot;Country:\t$country\n&quot;;
    $msg .= &quot;Zip:\t$zip\n&quot;;
	$msg .= &quot;Job:\t$job\n&quot;;
	$msg .= &quot;Function:\t$function\n&quot;;
	$msg .= &quot;Do They Want More Info In The Future:\t$info\n&quot;;
	
    mail(&quot;myname@cascadecorp.com&quot;, &quot;Register for Case Histories on Cascadepromotions.com&quot;,
          $msg, &quot;From: $email&quot;);
		  }
    ?>

that is not my email because i dont really want to start getting spam so i dont give out my company email

<signature>
sometime you just gotta say &quot;WHAT THE @#*% !!&quot;
</signature>
 
The firewall may block the email if it does not have an absolutely correctly formed email header, or if your firewall is configured incorrectly.

I have recently been forced to use a horrible asp mail script by a client's webhosting company. The mail that is sent from that will not go through our firewall because of the problem I described.

Sorry, but I woul dneed to do a search to find out exactly how to format the header info! ;-)
 
Deecee, In the case you gave, $email would have to contain a valid email id.

Example: &quot;Deecee@myhost.com&quot; would be ok.
whereas: &quot;Deecee&quot; would not be ok.



Clive
 
ya the form checks for a valid email &quot;@&quot; and &quot;.&quot; must be in the address.

<signature>
sometime you just gotta say &quot;WHAT THE @#*% !!&quot;
</signature>
 
Ummm...

Your firewall or target mail server may block the mail if it does not have a proper email header. This is to protect against malicious and spam mail. The PHP mail() function lets you send whatever you like as email, you can't blame some servers for insisting that what they receive conforms to 'correct' email protocols.

Your script only adds the &quot;From:&quot; parameter to the email.

try including some other headers, I am afraid I don't know which are explicitly required but try this...
(This is taken from Obviously replace the webmaster@domain.com with a legitimate email address.

Code:
$emailTo = &quot;
however you determine your mail to address
Code:
\n&quot;
$subject = &quot;
however you determine your subject
Code:
\n&quot;;
$subject = &quot;
however you determine your message
Code:
\n&quot;;
$headers .= &quot;From: Name<webmaster@domain.com>\n&quot;;
$headers .= &quot;Reply-To: <webmaster@domain.com>\n&quot;;
$headers .= &quot;X-Sender: <webmaster@domain.com>\n&quot;;
$headers .= &quot;X-Mailer: PHP4\n&quot;; //mailer
$headers .= &quot;X-Priority: 3\n&quot;; //1 UrgentMessage, 3 Normal
$headers .= &quot;Return-Path: <webmaster@domain.com>\n&quot;;

mail($emailTo,$subject,$message,$headers);

Also... there could be a problem with the PHP ini file.
Apparently if the sendmail_path is not legit then some mail won't get through.

I *think* this can be fixed with
Code:
ini_set(sendmail_path, &quot;/usr/sbin/sendmail -t -f webmaster@domain.com&quot;);
but i have not had time to try it out yet.
Again, replace the webmaster@domain.com with a legitimate email address.

Hope this helps... I will give it a go myself when I get some time.
 
i will try and get back on this one...thanks

<signature>
sometime you just gotta say &quot;WHAT THE @#*% !!&quot;
</signature>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top