logo
down
shadow

Basic PHP contact form receiving email but no message


Basic PHP contact form receiving email but no message

By : Simba Liu
Date : November 21 2020, 11:01 PM
With these it helps I'm using a guide found online for my first PHP contact form. Everything works great and the email is received except the message field is blank, all other parts are fine. I've taken a good look and there are hundreds of similar issues posted but I can't find any answers that work for me, sorry if the answer's out there already, all help greatly appreciated. , Remove the form="commentform" attribute from the messagetextarea...
code :
<textarea placeholder="Don't hold back..." name="message" class="textbox"></textarea>


Share : facebook icon twitter icon
PHP contact form submitting but not receiving email

PHP contact form submitting but not receiving email


By : Bruno Martić
Date : March 29 2020, 07:55 AM
With these it helps You have used sessions which is not required here, you can also use flag variable instead of arrays in this simple form, use this updated code.
code :
<?php
//$to_mail = "architects@palavin.com,t.lavin@palavin.com,12yorkcourt@gmail.com";
$to_mail = "danny@enhance.ie";
//$cc="paul@enhance.ie";
$mail_sent = 0;
if(isset($_POST['submit'])){
    //echo "the form was submitted";

$name = trim(strip_tags($_POST['name']));
if($name == "")
    $error = true;

$email = trim(strip_tags($_POST['email']));
if($email == "")
    $error = true;

$phone = trim(strip_tags($_POST['phone']));
$address = trim(strip_tags($_POST['address']));
$description = trim(strip_tags($_POST['description']));


if($error != true){
    $headers = 'From: "Euro Insulation" <no-reply@euroinsulations.ie>'."\r\n";
    //$headers .= 'CC: "'.$cc.'" <'.$cc.'>'."\r\n";
    $headers .= 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=utf-8' . "";

    $subject = "New contact message";

    $message = "New Contact message, received from: <br /> \n ";
    $message .= "<b>Name</b> ".$name."<br /> \n";
    $message .= "<b>Email</b> ".$email."<br /> \n";

    $message .= "<b>Phone</b> ".$phone."<br /> \n";
    $message .= "<b>Address</b> ".$address."<br /> \n";

    $message .= "<b>Description</b> ".$description."<br /> \n";

    if(@mail($to_mail,$subject,$message,$headers))
    {
        echo "mail sent";
        $mail_sent = 1;
    }
    else echo "mail not sent";
} else {
    echo 'validation error';
}
}
?> 
Error and not receiving email from contact form

Error and not receiving email from contact form


By : user3597195
Date : March 29 2020, 07:55 AM
hope this fix your issue You missed &in dataStringContact variable (8th line in JavaScript code snippet):
code :
var dataStringContact = 'contactSubject1='+ contactSubject + '&contactName1='+ contactName + '&contactEmail1='+ contactEmail + '&contactMessage1='+ contactMessage; 
                                                              ^
PHP contact form, not receiving email

PHP contact form, not receiving email


By : AuBrO
Date : March 29 2020, 07:55 AM
help you fix your problem As when I've previously set up contact forms I've been doing so using Code Igniter I didn't realise that I couldn't use mail() without installing a mail server.
to Parris Varney and RiggsFolly for pointing this out and thanks again to Riggs for letting me know that Code Igniter uses the PHPMailer library.
code :
$name = $_REQUEST['name'];
$co = $_REQUEST['company'];
$email = $_REQUEST['email'];
$tel = $_REQUEST['tel'];
$message = $_REQUEST['message'];

require("PHPMailerAutoLoad.php");

$mail = new PHPMailer();

$mail->isSMTP();

$mail->Host = "mail.mydomain.co.uk";
$mail->SMTPAuth = true;
$mail->Username = "me@mydomain.co.uk";
$mail->Password = "password";
$mail->SMTPAutoTLS = false;

$mail->From = $email;
$mail->addAddress("me@mydomain.co.uk", "Me");
$mail->WordWrap = 50;
$mail->isHTML(true);
$mail->Subject = "Enquiry";

$mail->Body = "From: $name<br>Company: $co<br>Email: $email<br>Telephone: $tel<br>Message: $message";
$mail->AltBody = "From: $name Company: $co Email: $email Telephone: $tel Message: $message";

if(!$mail->Send())
{
    echo "Message could not be sent";
}
echo "Message has been sent";
?>
django contact form receiving email for free

django contact form receiving email for free


By : Arpitha kalmady
Date : March 29 2020, 07:55 AM
seems to work fine I don't know why you're asking about email services, they have nothing to do with your question. Your email is blank because you don't seem to have any variable placeholders in your template. Add {{ contact_name }} etc to fill in the data, just as you would with an HTML template.
Contact Form 7 showing sent message but not receiving email

Contact Form 7 showing sent message but not receiving email


By : bbbkada
Date : March 29 2020, 07:55 AM
I hope this helps you . Try setting the from: email address to wordpress@yourdomain.com. Contact Form 7 support recommends setting the from address as being on your own domain, so that the website's mailer program doesn't think it is spoofing the email being sent (sending it from an incorrect email address).
If that doesn't work, best to use a plugin like WP Mail SMTP Plugin.
Related Posts Related Posts :
  • how to display controller array values in mvc concept?
  • While loop without explicit increment / counter (basic)
  • updated values are displaying only after refreshing the page
  • PHP: update on DB if i pass it through get url
  • Select * from table where columns contain a keyword
  • Wildcard to route to a controller
  • Unknown component ID: authClientCollection
  • make standings table soccer league
  • Laravel pusher error: JSON returned from webapp was invalid, yet status code was 200
  • How to get most downloads records
  • What argument does my function need to echo get_results() query results
  • Laravel - Toggle value in database with checkbox and ajax
  • $_POST is not working in web services?
  • How to Count the number of objects in elequont Object inside a group by in a already queried collection?
  • how to add custom column in db table when using 'into outfile' query
  • cant load more than 100 words in json android from sql
  • PHP: How to order array by a value of child array
  • composer dump-autoload not working on controller Laravel 5
  • How select random column value from Mysql database using PHP
  • Showing data with specific parameter in Wordpress Query
  • Why die with connect_error() is not working?
  • PHP foreach for child of multidimentional array?
  • how to load another page when clicking a button in another page and pass values to the loaded page in jquery?
  • Laravel eloquent updating tinyint (boolean)
  • How to Check/Uncheck single radio button
  • obtain values from MySQL table using PHP and display results in jQuery function as "option"
  • PHP complex while-loop logic
  • Show a post from selected categories wordpress
  • PHP DateTime: How can i re write code to run on PHP 5.1.6
  • Skip values in PHP XPath
  • ANDROID&PHP - Why am I getting this JSONArray parsing error
  • if row equals parameter from url
  • Set up Phalcon 3.0.x with Php 7.0.x in ubuntu16.04
  • Server picking up old files
  • CSS loading after HTML loads
  • Getting an error for double and boolean even boolean given
  • Create shipment using fedex api (php)
  • How to get the variable value from one controller to another controller?
  • Bind doesn't work on User model
  • Sort JSON date by date - PHP
  • apache log is filled with erros and warnings almost 25 gb each time
  • Chrome adding tags (#shadow-root (open))
  • Split an array based on the value of another array
  • CodeIgniter Calendar Preferences template not working
  • .htaccess mode rewrite does not affect page url
  • PHP Laravel 5 : Trait not found
  • php count values column
  • Ajax POST not recognised as part of current guest session, Laravel 5.3
  • Why is my contact form PHP script not working? No error log
  • Sorting racers / players by places
  • cURL empty request data if https connection
  • PHP/MYSQL - Multiple connections to the same database?
  • PHP: Handle only parents on array
  • PHP IF How to include multiple conditions?
  • Change price location in Woocommerce Single Product Layout
  • Turn string to array in PHP (all data recorder as string)
  • Sorting issues with mySQL JOIN
  • Get keys from multidimentional array by value
  • php accessing variables in constructor from included file
  • Mysqli can't insert multiple rows
  • shadow
    Privacy Policy - Terms - Contact Us © soohba.com