Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8410023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:04:26+00:00 2026-06-10T00:04:26+00:00

I have a script that mails me my form data for a classified ad.

  • 0

I have a script that mails me my form data for a classified ad. Yesterday when I left work it worked fine. Now it is only working in FireFox and I’m getting my “else” statement “We encountered an error sending your mail, please notify XXXX@XX.COM” in both Opera AND Safari which makes no sense to me.

What’s causing this error, and why does it fail in some browsers but work in others?

 <script language="javascript">
function submitt()
{
setTimeout('document.paypal.submit()',1000);
}
</script>

<?php 
 $to = "XXX@XXX.com" ; 
 $from = $_REQUEST['email'] ; 
 $name = $_REQUEST['Name'] ; 
 $headers = "From: $from"; 
 $subject = "Classified Tests"; 

 $fields = array(); 
 $fields{"Name"} = "Name";  
 $fields{"email"} = "Email"; 
 $fields{"Phone"} = "Phone"; 
 $fields{"Address"} = "Street Address";
 $fields{"City"} = "City";  
 $fields{"State"} = "State"; 
 $fields{"Zip"} = "Zip Code"; 
 $fields{"Classification"} = "Classification"; 
 $fields{"Ad-Headline"} = "Headline"; 
 $fields{"Ad-Content"} = "Ad Content"; 
 $fields{"Words"} = "Word Count"; 
 $fields{"Weeks"} = "Weeks to Run"; 
 $fields{"WordCount"} = "Total Words"; 
 $fields{"Rate"} = "Word Rate"; 
 $fields{"GrossAmountDue"} = "Gross Amount"; 
 $fields{"NonProfit"} = "Non Profit Ad?"; 

$item_name   = $_POST['item_name'];
$amount   = $_POST['amount'] ; 
$currency_code  = $_POST['currency_code'];
$no_shipping = $_POST['item_number'];
$shipping = $_POST['item_number'];
$cmd   = $_POST['cmd'];
$bn  = $_POST['bn'];
$no_note = $_POST['item_number'];
$lc   = $_POST['lc'];
$business   = $_POST['business'];

 $body = "This Ad has been submitted:\n\n"; foreach($fields as $a => $b){   $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } 

 if($from == '') {print "You have not entered an email, please go back and try again";} 
 else { 
 if($name == '') {print "You have not entered a name, please go back and try again";} 
 else { 
 $send = mail($to, $subject, $body, $headers); 
 if($send) 
 {print "Your Ad has been submitted, redirecting to paypal."; echo "<SCRIPT LANGUAGE='javascript'>submitt();</SCRIPT>";} 
 else 
 {print "We encountered an error sending your mail, please notify XXX@XXX.com"; } 
 }
}


 ?> 

<form action="https://www.paypal.com/cgi-bin/webscr" id="paypal" target="_self" name="paypal" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="XXXXXXXXXXXX">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Classified Ad">
<input type="hidden" name="amount" id="Amount" value="">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="cn" value="Add special instructions to the seller:">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="shipping" value="0.00">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">
</form>

What’s causing this error, and why does it fail in some browsers but work in others?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:04:28+00:00Added an answer on June 10, 2026 at 12:04 am

    It’ll work if you send it from your own email address with a PHP_EOL.

    mail("XXX@XXX.com", "subject", "body", "From: Me" . PHP_EOL); // 'From' can be anything
    

    See PHP: mail – Manual.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script that submits data via an ajax POST. It is called
I have a form that submits to PHP self. This script runs and says
I have a script (employment application form) that sends an html email with file
I have a simple script that just mails with PHP: mail( $webmaster_email, RSVP from
I have an HTML form that posts to a php script that then emails
I have created a form to email that uses this script: <?php foreach ($_POST
I have script that reads remote file content and writes it to local server.
I have this script that run to fix my menu bar to the browser
I have a script that recursively loops through all the sub directories and compresses
I have following script that executes all the .reg files in the current directory.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.