Comments (10)
Hey this is my first time working with php and i'm trying to use it in a contact form page to send the website owner a email, i'm not sure what the issue is but it wont send the the the email doesn't get sent to the website owner if you can give any advice please let me know thanks 👍
from simple-php-contact-form.
I can send you my snippet later today if you need to see it
from simple-php-contact-form.
@BigBird420 What error have you received? If you haven't received like me, I just change the code like above and started to work.
from simple-php-contact-form.
@aftoledo there are no error messages the site seems to be running the php file fine but it doesn’t send a email to the owners email account
from simple-php-contact-form.
If your problem is like mine, just change it:
$header .= 'From: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->sender_email . '>' . PHP_EOL;
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->sender_email . '>' . PHP_EOL;
to something like this:
$header .= 'From: ' . $this->from . PHP_EOL;
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->sender_email . '>' . PHP_EOL;
from simple-php-contact-form.
@aftoledo when I get home I’ll share my snippet looks different from yours
from simple-php-contact-form.
@aftoledo <?php
$name = $_POST['name'];
$visitor_email = $_POST['email'];
$message = $_POST['message'];
$email_form = '[email protected]';
$email_subject = "New Form Submission";
$email_body = "User Name: $name.\n".
"User Email: $visitor_email.\n".
"User Message: $message.\n";
$to = "[email protected]";
$headers = "form: $email_form \r\n";
$headers .= "Reply-To: $visitor_email \r\n";
mail($to,$email_subject,$email_body,$headers);
header("Location: index.html");
?>
from simple-php-contact-form.
I don't know if it matters, but try to change single to double cotes here:
$email_form = '[email protected]';
from simple-php-contact-form.
double and single quotes: https://stackoverflow.com/questions/3446216/what-is-the-difference-between-single-quoted-and-double-quoted-strings-in-php
from simple-php-contact-form.
hey it didnt end up working i just went back and restarted the form by using formspree and javascript thanks though
from simple-php-contact-form.
Related Issues (20)
- Recebimento HOT 5
- Works on some servers, but not others HOT 7
- Doesn't work with Yahoo or AOL? HOT 1
- Validation not working for me in Safari 9.1 HOT 1
- what is "from" field? HOT 2
- Error return HOT 5
- Where do I enter email information?
- PHP Parse Error HOT 1
- No validation for the phone number HOT 2
- All messages go to spam... HOT 1
- How do you extract the html from index.php? HOT 2
- 'from' field set as form field value, sent with 'to' address twice HOT 3
- Send a confirmation email HOT 1
- Senders IP addr
- More input fields
- demo link broken HOT 1
- CONTACT FORM DONT WORK
- PHP8 support
- smtp; 550 Messages should have one or no To headers, not 2. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple-php-contact-form.