PHP email form is not sending all fields - php

here is my html form
<form action="formmail1.php" method="post" enctype="multipart/form-data">
<li>
Name<br /><input name="name" type="text" id="name" size="50" maxlength="50" /> <br />
First and Last Name<br /><br />
</li>
<li>
Phone<br /><input name="phone" Type="text" id="email" size="12" maxlength="12"/><br />
___-___-____<br /><br />
</li>
<li>
Email<br />
<input name="email" Type="text" id="email" size="50"/><br />
Valid email address<br /><br />
</li>
<li>
How do you want to be contacted?<br />
<input Type="radio" name="how_to_be_contacted" id="r1" class="radio" value="1" /><label for="r1">Email</label><br />
<input Type="radio" name="how_to_be_contacted" id="r2" class="radio" value="2" /><label for="r1">Phone</label><br /><br />
</li>
<li>
I would like information about...<br />
<input name="aquatic_therapy" type="checkbox" id="aquatic_therapy" />Aquatic Therapy <input name="occupational_therapy" type="checkbox" id="occupational_therapy" />Occupational Therapy<br />
<input name="speech_therapy" type="checkbox" id="speech_therapy" />Speech Therapy <input name="reflex_integration" type="checkbox" id="reflex_integration" />Reflex Integration
<br />
Select all that apply<br />
</li>
<br />
<li>
Message<br />
<textarea name="message" cols="50" rows="10" id="message"></textarea><br />
</li>
</ol>
<input id="submit" type="submit">
Here is my PHP
<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
//send email
$name = $_REQUEST['name'] ;
$phone = $_REQUEST['phone'] ;
$email = $_REQUEST['email'] ;
$how_do_you_want_to_be_contcted = $_REQUEST['how_do_you_want_to_be_contcted'] ;
$information = $_REQUEST['information'] ;
$message = $_REQUEST['message'] ;
mail("email#nowhere.com", "Subject: Contact Us Form",
$message "From: $email" );
echo "Thank you for using our mail form";
else
//if "email" is not filled out, display the form
echo "<form method='post' action='mailform.php'>
Email: <input name='email' type='text' /><br />
Subject: <input name='subject' type='text' /><br />
Message:<br />
<textarea name='message' rows='15' cols='40'>
</textarea><br />
<input type='submit' />
</form>";
All that is sending is message text field but none of the other fields....

$_REQUEST['how_do_you_want_to_be_contcted'] won't work because the field name in the HTML code is how_to_be_contacted.
You're defining the phone field as $phone and then referring to $emailphone. That clearly won't work either.
mail("eweb#gmail.com", "Subject: Contact Us Form", $emailphone
$message "From: $email" );
This has syntax errors, so can't work at all as shown.
You haven't escaped any of the input values, so if someone enters something with invalid data it could break the program and/or result in the site getting hacked.

Checkboxes and Radio buttons aren't sent unless checked.

Here is another possibility:
the request name you are asking for is: how_do_you_want_to_be_contcted
in your form you call it: how_to_be_contacted

Related

mail.php can't get it to email the correct data

I've no experience with php, due to an old formtomail cgi script no longer working on a host server I decided to switch to a simple html to php mail for a contact page on a website. I took a template online and set up the html page but having difficulty editing the mail.php file so that all the data requests on my html form get emailed over to me. The template I use just had email and message. My html contact page has different requests i.e contact name not name, and asks for more information. so I need the php form to email all this information and need help on how to edit the php file to include whats requested on the html contact page.
I have a contact form HTML page with the following:
<form action="mail.php" method="POST">
<p class="bodytextgrey">
Contact Name:<br /><input type="text" name="contact name" size="50" /><br />
Firm Name:<br /><input type="test" name="firm name" /><br /><br />
E-mail: (Please enter the email address you would like the document is to be sent to)<br />
<input type="text" name="email" size="50" /><br />
Job Number:<br /><input type="test" name="job number" /><br /><br />
Document you require:<br /><form action=""><select name="Document you require">
<option value="Data Sheet">Data Sheet</option>
</select><br/ ><br />
Discount code:<br /><input type="text" name="Discount code" size="20" /><br /><br />
<input type="submit" value="Send"><input type="reset" value="Clear">
</form>
I then have a mail.php with this (MY EMAIL is my actual email):
<?php $name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent="From: $name \n Message: $message";
$recipient = "MY EMAIL";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!";
?>
Would also like it to bring up an existing thank you.html page rather than just a thankyou word on a white page so also need help adding in how I link this.
Any help would be appreciated
Formatting your code will help immensely to start debugging this. I've reformatted your current HTML with some indenting and line breaks to help make it clear:
<form action="mail.php" method="POST"> <!-- missing closing tag -->
<p class="bodytextgrey"> <!-- missing closing tag -->
Contact Name:<br />
<input type="text" name="contact name" size="50" /><br />
Firm Name:<br />
<input type="test" name="firm name" /><br /><br />
E-mail: (Please enter the email address you would like the document to be sent to)<br />
<input type="text" name="email" size="50" /><br />
Job Number:<br />
<input type="test" name="job number" /><br /><br />
Document you require:<br />
<form action=""> <!-- nested form in a form will break things -->
<select name="Document you require">
<option value="Data Sheet">Data Sheet</option>
</select><br/ ><br />
Discount code:<br />
<input type="text" name="Discount code" size="20" /><br /><br />
<input type="submit" value="Send">
<input type="reset" value="Clear">
</form>
There are a few things wrong with this:
Opening <p> with no </p> (closing tag) anywhere
<form action=""> nested inside of an existing form isn't allowed and will cause submission issues (see "Permitted content" at https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form)
The closing </form> that exists matches the <form action="">, but you're missing a </form>
You don't have a message field anywhere
Here's the updated HTML with my suggested fixes:
<form action="mail.php" method="POST">
<p class="bodytextgrey">
Contact Name:<br />
<input type="text" name="contact_name" size="50" /><br />
Firm Name:<br />
<input type="test" name="firm_name" /><br /><br />
E-mail: (Please enter the email address you would like the document to be sent to)<br />
<input type="text" name="email" size="50" /><br />
Job Number:<br />
<input type="test" name="job_number" /><br /><br />
Document you require:<br />
<select name="document">
<option value="Data Sheet">Data Sheet</option>
</select><br/ ><br />
Discount code:<br />
<input type="text" name="discount" size="20" /><br /><br />
Message:<br />
<textarea name="message"></textarea><br /><br />
<input type="submit" value="Send">
<input type="reset" value="Clear">
</p>
</form>
As others have mentioned, it's not clear what the 500 error is, so that will need to be resolved before this will work. But here's a cleaned up version of the PHP. This has been simply tested at https://3v4l.org/WePRh, though it won't show the form or any input values, but it does prove that the script runs. This is formatted better, includes all form inputs, and should make things easier to work with:
<?php
// get all form values
$input['Contact name'] = $_POST['contact_name'] ?? '';
$input['Firm name'] = $_POST['firm_name'] ?? '';
$input['Email'] = $_POST['email'] ?? '';
$input['Job number'] = $_POST['job_number'] ?? '';
$input['Document'] = $_POST['document'] ?? '';
$input['Discount'] = $_POST['discount'] ?? '';
$input['Message'] = $_POST['message'] ?? '';
// generate the email content (i.e. each line is like "Contact name: Mark")
$formContent = '';
foreach($input as $key => $value) {
$formContent .= $key . ": " . $value . "\n";
}
$to = "my#email.com"; // TODO: replace this with your email address
$subject = "Contact Form";
/*
Note that this was likely causing downstream issues. Most email clients (gmail, outlook) will mark emails as spam
if you try to send an email from an email address that your server isn't configured to send from.
See https://stackoverflow.com/questions/17533863/how-to-configure-php-to-send-e-mail for more info.
It's also safer to define an email address like "no-reply#example.com" to send your emails from.
*/
$mailheader = "From: no-reply#example.com";
mail($to, $subject, $formContent, $mailheader) or die('Error sending email');
// redirect to the thank you page
// TODO: update this URL to be yours
header('Location: http://www.example.com/thankyou.html');
exit;
?>
You can use the header() function:
Example:
header('location: thankyou.html');

No output when submitting a PHP form

So I'm trying to create a basic form using HTML and PHP.
I have the form setup on my contact.php page, yet when I enter the values and submit, no values are shown on the welcome.php page, which is where it should appear.
Here is my HTML code:
<form action="welcome.php" method="post">
<p>Your Name: <input type="text" name="yourname" /> </p><br/>
<p>E-mail: <input type="text" name="email" /></p>
<p>Do you like this website?</p>
<input type="radio" name="likeit" value="Yes" checked="checked" /> Yes
<input type="radio" name="likeit" value="No" /> No
<input type="radio" name="likeit" value="Not sure" /> Not sure</p>
<p>Your comments:<br />
<textarea name="comments" rows="10" cols="40"></textarea></p>
<p><input type="submit" value="Send it!"></p>
</form>
And here is my PHP code:
<html>
<body>
Your name is: <?php echo $_POST['yourname']; ?><br />
Your e-mail: <?php echo $_POST['email']; ?><br />
<br />
Do you like this website? <?php echo $_POST['likeit']; ?><br />
<br />
Comments:<br />
<?php echo $_POST['comments']; ?>
<br>
<br>
<br>
<button><-- BACK</button>
</body>
</html>
NOTE: - I am following a tutorial from http://myphpform.com/php-form-tutorial.php so I do not know why it is not working for me. If you could help then that would be truely amazing.
Thanks, DTV

PHP Email Function sending a blank body message with subject & sender email

I am trying to make a quote forum that sends the input to an email. I have PHP sending the email, displaying the subject and the senders email, but it doesn't display the main body of content in the email that is sent.. here is my code:
<?php
$action=$_REQUEST['action'];
if ($action=="") /* display the contact form */
{
?>
<div class="quote_text">Send us some of your information and we will get back to you as soon as possible. Let's get this ball rolling.</div>
<br /><br />
<span class="important">* = required fields</span><br />
<form action="" method="POST" enctype="multipart/form-data">
<table width="814" height="310" border="0">
<tr>
<td width="419">
<input type="hidden" name="action" value="submit">
Your Name:<span class="important">*</span><input name="name" type="text" value="" size="30"/><br /><br />
Your Email:<span class="important">*</span><input name="email" type="text" value="" size="30" placeholder="example#example.com"/><br /><br />
Phone Number:<input name="phone" type="text" value="" size="10" maxlength="12" placeholder="(xxx)-xxx-xxxx" /><br /><br />
Company Name:<input name="company_name" type="text" value="" size="30"/><br /> <br />
</td>
<td width="385">
Address of Installation:<span class="important">*</span>
<input name="install_address" type="text" value="" size="30"/><br /><br />
City:<span class="important">*</span><input name="city" type="text" value="" size="30"/><br /><br />
State:<span class="important">*</span><input name="state" type="text" value="" size="30"/><br /><br />
Zip Code:<span class="important">*</span><input name="zip" type="text" value="" size="30"/><br /><br /><br /><br />
</td>
</tr>
<tr>
<td height="102">
Fence Type Description:<br /><textarea name="description" rows="6" cols="45"></textarea>
Number of Corners:<input name="corners" type="text" value="" size="30"/>
</td>
<td><br />
Linear Feet:<input name="linear" type="text" value="" size="30"/><br />
OR<br />
Acres:<input name="acres" type="text" value="" size="30"/><br /><br />
Number of Gate Openings:<input name="gate_opening" type="text" value="" size="30"/>
</td>
</tr>
</table><br><br>
<input type="submit" value="Send email"/>
</form>
<?php
} else {
// Grab forum elements and push into variables for the email
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$phone = $_REQUEST['phone'];
$company_name = $_REQUEST['company_name'];
$install_address = $_REQUEST['install_address'];
$city = $_REQUEST['city'];
$state = $_REQUEST['state'];
$zip = $_REQUEST['zip'];
$description = $_REQUEST['description'];
$corners = $_REQUEST['corners'];
$linear = $_REQUEST['linear'];
$acres = $_REQUEST['acres'];
$gate_opening = $_REQUEST['gate_opening'];
//Build Email
$message="$name<br />
$email<br />
$phone<br />
$company_name<br />
$install_address<br />
$city<br />
$state<br />
$zip<br />
$description<br />
$corners<br />
$linear<br />
$acres<br />
$gate_opening<br />";
$message=$_REQUEST['message'];
if (($name=="")||($email=="")||($install_address="")||($city="")||($state="")|| ($zip=""))
{
echo "Please fill the required fields. Click here to try again.";
}
else{
$from="From: $name<$email>\r\nReturn-path: $email";
$subject="Blue Ridge Fencing - Quote Forum";
mail("info#blueridgefenceco.com", $subject, $message, $from);
echo "Email sent! We will get back to you as soon as possible.";
}
}
?>
Thank you so much for you help!

PHP contact form submitting 1's in all fields

I've recently developed a website for a freelance client of mine, and within their website is a Contact Form and a Request for Estimate form.
Once a day, both forms are being submitted and emailed to the designated email address. However, the submitted forms are clearly not from a real user, this is because all of the fields contain the number 1. For example, the name field will be Name:1, and the address field will be Address:1. The number 1 is repeated for all input text fields, and even radio and check box form fields.
Below is a copy of the PHP file that I am using to submit the Request for Estimate form.
<?
$subject="Associated Sennott Contractors Request For Estimate From:".$_GET['firstname'];
$headers= "From: ".$_GET['email']."\n";
$headers.='Content-type: text/html; charset=iso-8859-1';
mail("email#gmail.com", $subject, "
<html>
<head>
<title>Associated Sennott Contractors Request For Estimate</title>
</head>
<body>
<p><strong>Associated Sennott Contractors Request For Estimate</strong></p>
<p>
First Name: ".$_GET['firstname']." <br />
Last Name: ".$_GET['lastname']." <br />
Company Name: ".$_GET['company']." <br />
Address 1: ".$_GET['address1']." <br />
Address 2: ".$_GET['address2']." <br />
City: ".$_GET['city']." <br />
State: ".$_GET['state']." <br />
Zip: ".$_GET['zip']." <br />
Phone: ".$_GET['phone']." <br />
Fax: ".$_GET['fax']." <br />
Email: ".$_GET['email']." <br /><br />
<strong>Property Type:</strong><br />
Residential Single Family: ".$_GET['singlefamily']." <br />
Residential Multi-Family: ".$_GET['multifamily']." <br />
Residential Out-Building : ".$_GET['outbuilding']." <br />
Commercial Office: ".$_GET['commercial']." <br />
Retail Store: ".$_GET['retail']." <br />
Restaurant: ".$_GET['restaurant']." <br />
Industrial Building: ".$_GET['industrial']." <br /><br />
<strong>Requested Services:</strong><br />
Fire, Water or Wind Damage Restoration: ".$_GET['restoration']." <br />
Scope of Loss Estimate to Insurance Company: ".$_GET['scope']." <br />
Smoke Odor Remediation: ".$_GET['smoke']." <br />
Exterior Remodeling or Siding: ".$_GET['exterior']." <br />
Interior Remodeling: ".$_GET['interior']." <br />
Hardwood and Laminate Flooring: ".$_GET['flooring']." <br />
Finish Carpentry: ".$_GET['carpentry']." <br />
Demolition and Debris Removal: ".$_GET['demo']." <br />
Exterior Decks, Patios and Fencing: ".$_GET['patio']." <br />
Other: ".$_GET['other']." <br /><br />
<strong>Additional Information:</strong><br />
Message: ".$_GET['info']."
</p>
</body>
</html>" , $headers);
header( 'Location: thankyou.html' ) ;
?>
You can also view the PHP code by follow the link here: http://sennottcontractors.com/home-repair-estimate/quote-code.html
You can then view the HTML code for the actual form below:
<!DOCTYPE>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Request An Estimate Form</title>
<script type="text/javascript">
function formSubmit()
{
document.getElementById("estimate-form").submit();
}
</script>
</head>
<body>
<fieldset>
<legend><h3>Request a Home Restoration Estimate</h3></legend>
<form id="estimate-form" name="estimate-form" target="_parent" method="get" action="quote.php" onsubmit='return formValidator()'>
<p><strong>Contact Information</strong></p>
<p>First Name: *<br />
<input type="text" size="40" name="firstname" id="firstname" /></p>
<p>Last Name: *<br />
<input type="text" size="40" name="lastname" id="lastname" /></p>
<p>Company Name:<br />
<input type="text" size="40" name="company" id="company" /></p>
<p>Address 1: *<br />
<input type="text" size="40" name="address1" id="address1" /></p>
<p>Address 2:<br />
<input type="text" size="40" name="address2" id="address2" /></p>
<p>City: *<br />
<input type="text" size="30" name="city" id="city" /></p>
<p>State: *<br />
<input type="text" size="5" name="state" id="state" /></p>
<p>Zip: *<br />
<input type="text" size="10" name="zip" id="zip" /></p>
<p>Phone: *<br />
<input type="text" size="20" name="phone" id="phone" /></p>
<p>Fax:<br />
<input type="text" size="20" name="fax" id="fax" /></p>
<p>Email: *<br />
<input type="text" size="40" name="email" id="email" /></p>
<br />
<p><strong>Property Type</strong> *</p>
<p><input type="checkbox" name="singlefamily" id="singlefamily"/> Residential Single Family</p>
<p><input type="checkbox" name="multifamily" id="multifamily"/> Residential Multi-Family <em>(Condominium, apartment, town house, ect)</em></p>
<p><input type="checkbox" name="outbuilding" id="outbuilding"/> Residential Out-Building <em>(Garage, shed, ect)</em></p>
<p><input type="checkbox" name="commercial" id="commercial"/> Commercial Office</p>
<p><input type="checkbox" name="retail" id="retail"/> Retail Store</p>
<p><input type="checkbox" name="restaurant" id="restaurant"/> Restaurant</p>
<p><input type="checkbox" name="industrial" id="industrial"/> Industrial Building</p>
<br />
<p><strong>Requested Services</strong> *</p>
<p><input type="checkbox" name="restoration" id="restoration"/> Fire, Water or Wind Damage Restoration</p>
<p><input type="checkbox" name="scope" id="scope"/> Scope of Loss Estimate to Insurance Company</p>
<p><input type="checkbox" name="smoke" id="smoke"/> Smoke Odor Remediation</p>
<p><input type="checkbox" name="exterior" id="exterior"/> Exterior Remodeling or Siding</p>
<p><input type="checkbox" name="interior" id="interior"/> Interior Remodeling</p>
<p><input type="checkbox" name="flooring" id="flooring"/> Hardwood and Laminate Flooring</p>
<p><input type="checkbox" name="carpentry" id="carpentry"/> Finish Carpentry</p>
<p><input type="checkbox" name="demo" id="demo"/> Demolition and Debris Removal</p>
<p><input type="checkbox" name="patio" id="patio"/> Exterior Decks, Patios and Fencing</p>
<p><input type="checkbox" name="other" id="other"/> Other</p>
<br />
<p><strong>Additional Information</strong><br />
Please provide any information regarding details of your home restoration project or additional information to your requested services.</p>
<p><textarea rows="10" cols="65" id="info" name="info"></textarea></p>
<button type="submit" id="submit" onclick="formSubmit()">Submit</button>
</form>
<p>* Required Fields</p>
</fieldset>
</body>
</html>
The Request an Estimate form that is using the PHP file and code mentioned above you can view by following the link here: http://sennottcontractors.com/home-repair-estimate/index.html
Again, both the Request an Estimate form and the Contact Form are being submitted once a day, everyday, with the number 1 in every form field.
My guess is that this may be an issue with the PHP file itself, or it may be an issue from the server side of the hosted website.
Please help!!!
There's nothing technically wrong with your form. You said the cause of the issue yourself: "... the submitted forms are clearly not from a real user ...". So the solution is to make your form anti-bot. See this question on the pro Webmasters site for how you can do this: Make your site anti-bot?
One part of this problem is that you need to use a form nonce or "token".
Form.php
<?php
session_start();
$_SESSION['token'] = md5(mt_rand() . unique_id('form', TRUE));
...
?>
<form>
<input type="hidden" value="<?php print $_SESSION['token']; ">
...
</form>
process.php
<?php
session_start();
if($_SESSION['token'] !== $_POST['token'])
{
die('They did not load the form!');
}
...
(validation)
...
$db->insert($record);
You're not doing any validation. What do you expect?
Anyone could just grab the form fields, create the URL (because you're using GET instead of POST), and submit it ad nauseum if they wanted to. What you're probably encountering is a bot trying to figure out if it can hijack your form to send emails where it wants to send them.
What you should do is switch to using POST and check the $_SERVER['HTTP_REFERER'] variable to make sure it's coming from your form (at least). You could also use a CAPTCHA, but those are becoming increasingly unreliable. You could take this further and use a validation class to set rules for each field and what kind of data is allowed to be in each one.
Forms are easily manipulated, so if you expect to have any integrity in your form submissions, you should be doing the validation on the server-side. Client-side validation doesn't hurt, but only use it for user experience purposes, not to ensure data integrity.

PHP Mail stops working [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
PHP Mail stops working without me editing the code
I've had a problem with a clients mail function for a while. The thing is that the mail I use to receive the mails stops receiving mails from time to time. I've noticed this because when I change from my clients mail (info#allflytt.com) to my own (daniel#codia.se) it starts working properly. Also the "success function" gives me the message "The mail was not sent." when I use my clients mail (info#allflytt.com). So the problem seems to be located in the mailadress wich somehow, sometimes, doesn't accept the mails. This happens a couple of times every day and all I can do is wait for it to work again. I've posted the code below.
<?php
if(isset($_POST['submit'])){
$mottagare = 'info#allflytt.com';
$titel = 'Meddelande';
$namn = strip_tags($_POST['namn']);
$foretag = strip_tags($_POST['foretag']);
$adress = strip_tags($_POST['adress']);
$postnr = strip_tags($_POST['postnr']);
$ort = strip_tags($_POST['ort']);
$telefon = strip_tags($_POST['telefon']);
$epost = strip_tags($_POST['epost']);
$meddelande = strip_tags($_POST['meddelande']);
$meddelande=nl2br($meddelande);
$body =
"
Namn: <b>". $namn ."</b><br />
Företag: <b>". $foretag ."</b><br />
Adress: <b>". $adress ."</b><br />
Postnr: <b>". $postnr ."</b><br />
Ort: <b>". $ort ."</b><br />
Telefon: <b>". $telefon ."</b><br />
E-post: <b>". $epost ."</b><br /><br />
Meddelande: <b><br />". $meddelande
;
$headers = 'From: '. $namn .' <webmaster#allflytt.com>' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();
$success = mail($mottagare, $titel, $body, $headers);
}
?>
<?php
if(!($success)){
echo "<p class=\"field_error\">The mail was not sent.</p>";
}
?>
<?php
if($success){
echo "<p class=\"p_success\">Great! The mail was sent.</p>";
}
?>
<form method="post" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>">
<p>
<label for="namn">Namn: *</label><br />
<input type="text" name="namn" id="namn" class="text" tabindex="15" />
<br />
<label for="foretag">Företag:</label><br />
<input type="text" name="foretag" id="foretag" class="text" tabindex="20" />
<br />
<label for="adress">Adress:</label><br />
<input type="text" name="adress" id="adress" class="text" tabindex="30" />
<br />
<label for="postnr">Postnummer:</label><br />
<input type="text" name="postnr" id="postnr" class="text_medium" tabindex="40" />
<br />
<label for="ort">Ort:</label><br />
<input type="text" name="ort" id="ort" class="text" tabindex="50" />
<br />
<label for="telefon">Telefon: *</label><br />
<input type="text" name="telefon" id="telefon" class="text" tabindex="60" />
<br />
<label for="epost">E-post:</label><br />
<input type="text" name="epost" id="epost" class="text" tabindex="70" />
<br />
<label for="meddelande">Meddelande: *</label><br />
<textarea name="meddelande" id="meddelande" class="textarea" tabindex="80"></textarea>
<br />
<input type="submit" name="submit" value="Skicka" class="submit" />
</p>
</form>
The problem is likely with the $namn variable, which can get practically any value, and therefore could either not be a valid e-mail at all, or could be an e-mail that's being blocked by the recipient.
Firstly you should make sure that $namn is a valid e-mail, but personally I would recommend that you use a single constant address for your From, preferably one the domain of which resolves to your mail server's IP.
Problem solved. Changed to a new server host. No issues any more!

Categories