Jump to content

Search the Community

Showing results for tags '$sendemail'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I have a php script that emails a completed order form linked to the script and sends a coppy (cc) to the sender. It has worked for years, until last week - the hosting company now tells me I need to amend the script as it uses the sender's email address as the "from" address and the server now prevents emails with this format as it can contain a spoofed from address. This is the script: <?php $file = $_POST['file']; $company = $_POST['company']; $ordered = $_POST['ordered']; $email = $_POST['email']; $date = $_POST['date']; $po = $_POST['po']; $requirements = $_POST['requirements']; /*products*/ $Product1 = $_POST['Product1']; $Product2 = $_POST['Product2']; /*TOTAL*/ $total = $Product1 + $Product2; /*Sending Email*/ $to = $_POST['to']; $subject = "Orders by $company"; $message = " FILE = $file Company = $company Ordered = $ordered Email = $email Date = $date PO = $po Requirements = $requirements PRODUCTS ---------------------------------------------- Product1 = $Product1 Product2 = $Product2 ----------------------------------------------------------- TOTAL PRODUCTS ORDERED = $total"; $headers = "From: $email\r\n"; $headers .= "Cc: $email\r\n"; if(mail($to, $subject, $message, $headers) echo "<table width='700' border='0' align='center' cellpadding='5' cellspacing='0'> <tr> <td>Thank you for submitting your online <strong>Orders</strong>. A copy of the order has been sent to your email address. Please check all details are correct.<br /> <br /> </td> </tr> <tr> <td><hr width='100%' size='1' noshade='noshade' /></td> </tr> </table>"; else echo "Mail send failure - message not sent"; ?> This is what the hosts told me to do: And this is how I amended the script: <?php $file = $_POST['file']; $SendEmail ="me@mydomain.com"; $company = $_POST['company']; $ordered = $_POST['ordered']; $email = $_POST['email']; $date = $_POST['date']; $po = $_POST['po']; $requirements = $_POST['requirements']; /*products*/ $Product1 = $_POST['Product1']; $Product2 = $_POST['Product2']; /*TOTAL*/ $total = $Product1 + $Product2; /*Sending Email*/ $to = $_POST['to']; $SendEmail ="me@mydomain.com"; $subject = "Orders by $company"; $message = " FILE = $file Company = $company Ordered = $ordered Email = $email Date = $date PO = $po Requirements = $requirements PRODUCTS ---------------------------------------------- Product1 = $Product1 Product2 = $Product2 ----------------------------------------------------------- TOTAL PRODUCTS ORDERED = $total"; $headers = "From: $email\r\n"; $headers .= "Cc: $email\r\n"; if(mail($to, $subject, $message, $headers, '-f'.$SendEmail)) echo "<table width='700' border='0' align='center' cellpadding='5' cellspacing='0'> <tr> <td>Thank you for submitting your online <strong>Orders</strong>. A copy of the order has been sent to your email address. Please check all details are correct.<br /> <br /> </td> </tr> <tr> <td><hr width='100%' size='1' noshade='noshade' /></td> </tr> </table>"; else echo "Mail send failure - message not sent"; ?> But still no result. I have now spent days trying variations on this, all without success. I get a confirmation page, but no emails are sent. Any suggestions would be much appreciated. Thank you
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.