This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

No emails sent via PHP Mail() function
#5
RE: No emails sent via PHP Mail() function
(04-12-2016, 12:33 AM)Me.B Wrote: can you check postfix queue to see where the file ended?

Also sending email that way can cause issues. As the sender may some time authorize few smtp servers to send on his behalf using SPF. Best is setting FROM as sever@domain.com.

M B

I'll check the postfix queue here in a sec.  I've changed the php to the below quoted code, but still no dice.

Code:
<?php
if(isset($_POST['submit'])){
   $to = "email@domain.com (not hosted on same server)";
   $to2 = $_POST['email'];
   $from = "email@domain.com (hosted on same server)";
   $name = $_POST['name'];
   $email = $_POST['email'];
   $telephone = $_POST['telephone'];
   $contactmethod = $_POST['contactmethod'];
   $subject = "Form submission";
   $subject2 = "Copy of your form submission";
   $message = $name . " wrote the following:" . "\n\n" . $_POST['message'];
   $message2 = "Here is a copy of your message " . $name . "\n\n" . $_POST['message'];

   $headers = "From:" . $from;
   $headers2 = "From:" . $to;
   mail($to,$subject,$message,$telephone,$email, $contactmethod,$headers);
   mail($to2,$subject2,$message2);
   echo "Mail Sent. Thank you " . $name . ", we will contact you shortly.";
   }
?>
Reply
Thanks given by:


Messages In This Thread
RE: No emails sent via PHP Mail() function - by kwongger - 04-12-2016, 04:08 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Why can i not send emails from my site phabeon8 3 7 ,544 04-20-2021, 06:29 AM
Last Post: sparkrack
External mail client cannot connect to server iraqiboy90 2 7 ,020 02-28-2021, 11:34 AM
Last Post: iraqiboy90
Postfix mail.log to database stikekar 2 8 ,238 03-02-2019, 01:22 AM
Last Post: TGates

Forum Jump:


Users browsing this thread: 7 Guest(s)