/    Sign up×
Community /Pin to ProfileBookmark

Hi Guys

You’re probably thinking this should go in the php room but im nearly 100% sure the php script is correct.

I have a quotation form (i.e. a contact form) on a html that then goes to a php page to submit an email to my clients ac – see below.

[URL=”http://www.metal-closures.co.uk/contact_quotationform.html”]http://www.metal-closures.co.uk/contact_quotationform.html[/URL]

However he uses Outlook/ MS Exchange ( I will point out now, I have never used exchange in my life and not really sure how it effects things).

IF I fill the form in with my details online and click send, my client receives the email in his inbox and the same when my business partner does it from his computer elsewhere.

But when my client fills the form in from his computer and clicks send then he receives NO email at all…

So im fairly sure the php script works because it works just not when my client does it. My client is using IE 8 and Outlook 07 and MS Xchng.

Here is the code below for any geeks like me ? lol

HTML Page:

[code=html] <h3>Quotation Form </h3>
<form name=”enquiry” id=”enquiry” method=”post” action=”contact_quotationthankyou.php”>
<table width=”400″ border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td height=”30″>Name:</td>
<td><input name=”name” type=”text” id=”name”></td>
</tr>
<tr>
<td height=”30″>Position:</td>
<td><input name=”position” type=”text” id=”position”></td>
</tr>
<tr>
<td height=”30″>Company:</td>
<td><input name=”company” type=”text” id=”company”></td>
</tr>
<tr>
<td height=”30″>Email:</td>
<td><input name=”email” type=”text” id=”email”></td>
</tr>
<tr>
<td height=”30″ >Telephone:</td>
<td><input name=”phone” type=”text” id=”phone”></td>
</tr>
<tr>
<td height=”30″>Call Me: </td>
<td><input name=”callme” type=”checkbox” id=”callme” value=”Yes”> </td>
</tr>
<tr>
<td height=”30″>Services Interest in: </td>
<td><table width=”400″ border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td height=”30″ colspan=”4″><hr></td>
</tr>
<tr>
<td><input name=”screwcaps” type=”checkbox” id=”screwcaps” value=”Yes”></td>
<td height=”20″>Screw Caps </td>
<td><input name=”sliplidcontainers” type=”checkbox” id=”sliplidcontainers” value=”Yes”></td>
<td>Slip Lid Containers </td>
</tr>
<tr>
<td><input name=”polishtins” type=”checkbox” id=”polishtins” value=”Yes”></td>
<td height=”20″>Polish Tins</td>
<td><input name=”pharmacueticalcaps” type=”checkbox” id=”pharmacueticalcaps” value=”Yes”></td>
<td>Pharmaceutical Caps</td>
</tr>
<tr>
<td><input name=”snufftins” type=”checkbox” id=”snufftins” value=”Yes”></td>
<td height=”20″>Snuff Tins</td>
<td><input name=”compositetubeends” type=”checkbox” id=”compositetubeends” value=”Yes”></td>
<td>Composite Tube Ends</td>
</tr>
<tr>
<td><input name=”vacuumsealed” type=”checkbox” id=”vacuumsealed” value=”Yes”></td>
<td height=”20″>Vacuum Sealed </td>
<td><input name=”bespokework” type=”checkbox” id=”bespokework” value=”Yes”></td>
<td>Bespoke Work</td>
</tr>
</table></td>
</tr>
<tr>
<td height=”149″>Your Requirements: </td>
<td><textarea name=”enquirytext” cols=”40″ rows=”7″ id=”enquirytext”></textarea></td>
</tr>
<tr>

<td height=”30″>&nbsp;</td>
<td><input type=”submit” name=”submit” value=”Send”></td>
</tr>
</table>
</form>[/code]

And PHP code is…

[code=php]<?php
if(isset($_POST[‘submit’])) {

$to = “[email protected]”;
$subject = “Metal-Closures Quotation Form”;
$name = $_POST[‘name’];
$email = $_POST[’email’];
$position = $_POST[‘position’];
$company = $_POST[‘company’];
$telephone = $_POST[‘phone’];
$callme = $_POST[‘callme’];
$screwcaps = $_POST[‘screwcaps’];
$sliplidcontainers = $_POST[‘sliplidcontainers’];
$polishtins = $_POST[‘polishtins’];
$pharmacueticalcaps = $_POST[‘pharmacueticalcaps’];
$snufftins = $_POST[‘snufftins’];
$compositetubeends = $_POST[‘compositetubeends’];
$vacuumsealed = $_POST[‘vacuumsealed’];
$bespokework = $_POST[‘bespokework’];
$enquirytext = $_POST[‘enquirytext’];

$body = “Name: $namen
E-Mail: $emailn
Position: $position n
Company: $company n
Telephone: $phone n
Call me: $callme n
Screw caps: $screwcaps n
Slip Lid Contianers: $sliplidcontainers n
Polish tins: $polishtins n
Pharmacuetical Caps: $pharmacueticalcaps n
Snuff tins: $snufftins n
Composite Tube Ends: $compositetubeends n
Vacuum Sealed: $vacuumsealed n
Bespoke Work: $bespokework n
Enquiry: $enquirytext
“;

mail($to, $subject, $body);

} else {

echo “error!”;

}
?>[/code]

Any help would be much appreciated..

Thanks

to post a comment
HTML

7 Comments(s)

Copy linkTweet thisAlerts:
@ryanbutlerDec 02.2009 — Just curious, is this form always sending to a specific email address? If so, have you switched the email to be sent to the client?
Copy linkTweet thisAlerts:
@slaughtersDec 02.2009 — It may be getting blocked in the Exchange Server. A lot of corps put strange rules on what they block when it comes from an outside source.

When he fills out the form does he fill in his own email address ? An email coming from an outside source with the "From" and "To" values matching exactly may be triggering one of those rules that is attempting to block spammers.
Copy linkTweet thisAlerts:
@kiwibritDec 02.2009 — Looks like a firewall problem to me. There is so much spam around that understandably firewall rules are getting more and more strict. You have to make some effort to get your emails acceptable your recipient. [url=http://www.amset.info/exchange/dnsconfig.asp]Have a look here[/url] - and [url=http://en.wikipedia.org/wiki/Anti-spam_techniques]this Wikipedia article[/url] is also worth a look.
Copy linkTweet thisAlerts:
@ryanbutlerDec 02.2009 — I used to send emails to an exchange server with PHP and it was a tight firewall (more so than necessary), never had problems. That must be one heck of a secured and tight firewall rules.
Copy linkTweet thisAlerts:
@theacidfrogauthorDec 04.2009 — to reply to ryanbutler.. yes it is only going to one email address as per above script.

Also when he got this in his inbox today:

"Your message did not reach some or all of the intended recipients.

Subject: RE: Metal-Closures Quotation Form

Sent: 03/12/2009 12:02



The following recipient(s) cannot be reached:

[email][email protected][/email] on 04/12/2009 12:25

The e-mail system was unable to deliver the message, but did not report a specific reason. Check the address and try again. If it still fails, contact your system administrator.

< meaney.metal-closures.co.uk #4.0.0 X-Postfix; connect to linweb01.linvh1.fasthosts.co.uk[10.216.7.0]: Connection timed out>

"

Any more ideas?
Copy linkTweet thisAlerts:
@theacidfrogauthorDec 04.2009 — Also just read this on php.net website...

"Problem: mail disappearing; not being sent

There are many reasons why your mail might fail to be sent, but one particularly obscure reason is as follows.

You must take extra care if the machine that is sending the mail also operates mail forwarding for your domain and you are sending mail to a user at that domain. In this situation, it is common for the MTA to avoid doing a "proper" MX look-up because it "knows" that there is a local list of mail-forwarding rules. This saves resources, and normally shouldnt be a problem, of course.

HOWEVER, if you deliberately alter your MX record to point to a mail server hosted elsewhere and, e.g. update your mail forwarding rules at that location, AND the server that sends your PHP-generated mail "decides" that it will save resources by not checking the MX record THEN it will use your old set of forwarding rules because it is ignoring your MX record.

If an appropriate forwarding rule does not exist locally, then the mail may be dropped without generating any error (i.e. no "bounce" message).

The symptom of the problem is that mail to certain users at your domain will be wrongly delivered or not delivered at all.

An obscure problem, perhaps, but one that I have experienced, and which took a long time to solve!"

.. that is the situation im in, (i.e. points to a different MX record - Xchange). Any ideas on how to resolve it?
Copy linkTweet thisAlerts:
@ryanbutlerDec 04.2009 — I would contact the system administrator for the email that's having problems receiving to make sure it's not something on their end.
×

Success!

Help @theacidfrog spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...