Page 1 of 1

Autoresponder - capitalisation

Posted: Sat Sep 18, 2010 3:33 pm
by kdidymus
Here's a "helpful" e-mail I've just received from Pickaweb's Customer Support...
Hi Kris,

We have checked the issue regarding the contact form on your website.

In the auto-responder, the first letter of a 'Name' is not capitalized. From our investigation, it was clear that a particular block of 'code' had to be integrated with your PHP file(sendmail.php).

In this context, you may note that providing extensive coding support is beyond our scope of work.

Hence, kindly contact a 'coding' expert or web developer who can integrate the required code in your PHP file.

Feel free to get back to us for more assistance in future.
Does anyone have ANY idea what they're talking about? I am designing a website which uses a sendmail.php to submit a contact form. There's an autoresponder on Pickaweb's server which sends an automated response to the sender BUT (and this is going to sound really insignificant) the message received from the autoresponder loses the capitalisation of the sender's name.

So it starts "Dear kate winslet" instead of "Dear Kate Winslet". I think it's a configuration problem with Pickaweb but they're insisting I need to add a "block of code" to my PHP.

I've already used $name = ucwords($name); and I'm not sure what else they can mean.

Thanks in advance.

Re: Autoresponder - capitalisation

Posted: Sat Sep 18, 2010 3:44 pm
by josh
Can you post the script? In my experience, I've had web hosts blame things on code problems to avoid providing service.

Re: Autoresponder - capitalisation

Posted: Sat Sep 18, 2010 3:49 pm
by kdidymus
Of course! Sorry - should have done that to begin with. Here it is...

Code: Select all

<?php

/* Program: sendmail.php
 * Version: 1.00
 * Details: Checks Captcha and actions accordingly
 * Author:  Kris Didymus
 * Date:    16/09/2010
 * Revised: 16/09/2010
*/

// CONNECT TO MYSQL DATABASE

include_once("../*******.inc.php");
$cxn = mysql_connect($host,$user,$password)
       or die ("Couldn't connect to server");
mysql_select_db($database);

// SET BASIC VARIABLES FOR PROGRAM

$ac = "align='center'";
$al = "align='left'";
$ar = "align='right'";
$vab = "valign='bottom'";
$vat = "valign='top'";

// DOWNLOAD PHONE NUMBER

$query = "SELECT * FROM contact WHERE urn='1'";
$result = mysql_query($query)
          or die ("Couldn't execute query.");

while ($row = mysql_fetch_assoc($result))
extract ($row);

$phone = $number;

// GET & FORMAT STRINGS FROM CONTACT.PHP

$code = mysql_real_escape_string($_GET['captcha']);
$code = strtolower($code);
$name = mysql_real_escape_string($_GET['name1']);
$name = ucwords($name);
$email = mysql_real_escape_string($_GET['emailfrm']);
$phone = mysql_real_escape_string($_GET['phone1']);
$comments = stripslashes(htmlentities($_GET['comments1']));

// CHECK FOR CORRECT CAPTCHA RESPONSE

$query = "SELECT * FROM email WHERE urn='$code'";
$result = mysql_query($query)
          or die ("Couldn't execute query.");

// CORRECT RESPONSE? SEND MAIL

if(mysql_num_rows($result)==1)
{
while ($row = mysql_fetch_assoc($result))
extract ($row);

$recipient = $email1;

mail( "$recipient", "E-Mail from $name ($phone)", $comments, "From: $name<$email>" );

// ECHO THANK YOU HTML

echo "
 
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
<title>She! Beauty Therapy - because She is fabulous!</title>
<meta name='author' content='Kris Didymus'/>
<meta name='keywords' content='beauty,therapy,mobile,winchmore,hill,manicures,waxing,eyes,lashes,tanning,skincare,pedicures,curls,facials,late,duchess,minx'/>
<meta name='description' content='She! Beauty Therapy (Winchmore Hill, London, UK). Fully qualified and insured beauty therapist. Competitive rates. Mobile and out of hours service available.'/>
<meta http-equiv='content-type' content='text/javascript' />
<link rel='stylesheet' href='../css/contact.css' type='text/css' media='screen' />
<link rel='icon' href='../favicon.ico' type='image/x-icon' />
<link rel='shortcut icon' href='../favicon.ico' type='image/x-icon' />
</head>
 
<body>
<div>
<br/><br/><br/><br/>
<table class='container' cellspacing='0' cellpadding='0'>
	<tr>
		<td class='shelogo'>&nbsp;</td>
		<td class='phone' valign='bottom'><table class='navblock' border='0' cellspacing='0' cellpadding='0'>
	<tr class='nav'>
		<td align='center'>About Us</td>
		<td align='center'>Contact Us</td>
		<td align='center'>Services</td>
		<td align='center'>Blah</td>
	</tr>
	<tr class='phone'>
		<td class='pagelogo' colspan='2' align='left'>&nbsp;&nbsp;<img src='../graphics/contact/contact.jpg' width='117' height='23' alt='Contact Us'/></td>
		<td class='phonebar' colspan='2' align='left'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$number</td>
	</tr>
</table></td>
	</tr>
	<tr>
		<td class='lashes'>&nbsp;</td>
		<td class='main' $ac>
		<table class='thanks' border='0' cellspacing='0' cellpadding='0'>
			<tr>
				<td>
				<img border='0' src='../graphics/contact/thanks.jpg' width='108' height='31'></td>
			</tr>
			<tr>
				<td>Your message has reached us safely and will receive our full 
				attention just as soon as possible.<p>Relax. You're one step 
				closer to being fabulous!</p>
				<p>We aim to respond to e-mails within twenty four hours but 
				during busy periods this may take a little longer. Thank you in advance for 
				your patience.</td>
			</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td class='tagline'>&nbsp;</td>
		<td class='baseline' valign='bottom' align='center'>She! &copy;2010 Christine 
		Jacquemin | Website &copy;2010 <a class='hidden' href='http://www.didymus.org.uk/contact/index.php' title='Want a website like this? Click here to contact the designer.'>
		Kris Didymus</a></td>
	</tr>
</table>
</div>
</body>
 
</html>";

exit;}

// INCORRECT RESPONSE? POPULATE FORM AND GIVE ERROR

else
{
// SET BASIC VARIABLES FOR PROGRAM

$ac = "align='center'";
$al = "align='left'";
$ar = "align='right'";
$vab = "valign='bottom'";
$vat = "valign='top'";
$i = rand(1,10);
echo "
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
<title>She! Beauty Therapy - because She is fabulous!</title>
<meta name='author' content='Kris Didymus'/>
<meta name='keywords' content='beauty,therapy,mobile,winchmore,hill,manicures,waxing,eyes,lashes,tanning,skincare,pedicures,curls,facials,late,duchess,minx'/>
<meta name='description' content='She! Beauty Therapy (Winchmore Hill, London, UK). Fully qualified and insured beauty therapist. Competitive rates. Mobile and out of hours service available.'/>
<meta http-equiv='content-type' content='text/javascript' />
<link rel='stylesheet' href='../css/contact.css' type='text/css' media='screen' />
<link rel='icon' href='../favicon.ico' type='image/x-icon' />
<link rel='shortcut icon' href='../favicon.ico' type='image/x-icon' />
</head>

<body>
<div>
<br/><br/><br/><br/>
<table class='container' cellspacing='0' cellpadding='0'>
	<tr>
		<td class='shelogo'>&nbsp;</td>
		<td class='phone' valign='bottom'><table class='navblock' border='0' cellspacing='0' cellpadding='0'>
	<tr class='nav'>
		<td $ac>About Us</td>
		<td $ac>Contact Us</td>
		<td $ac>Services</td>
		<td $ac>Blah</td>
	</tr>
	<tr class='phone'>
		<td class='pagelogo' colspan='2' $al>&nbsp;&nbsp;<img src='../graphics/contact/contact.jpg' width='117' height='23' alt='Contact Us'/></td>
		<td class='phonebar' colspan='2' $al>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$number</td>
	</tr>
</table></td>
	</tr>
	<tr>
		<td class='lashes'>&nbsp;</td>
		<td class='main' $al><form method='get' action='sendmail.php'><table class='contform' border='0' cellspacing='0' cellpadding='0'>
	<tr>
		<td $ar>Name:</td>
		<td>&nbsp;</td>
		<td>
		<input class='text' type='text' name='name1' size='30' value='$name'/>
		</td>
	</tr>
	<tr class='spacer'>
		<td></td>
		<td></td>
		<td></td>
	</tr>
	<tr>
		<td $ar>E-Mail:</td>
		<td>&nbsp;</td>
		<td><input class='text' type='text' name='emailfrm' size='30' value='$email'/></td>
	</tr>
	<tr class='spacer'>
		<td></td>
		<td></td>
		<td></td>
	</tr>
	<tr>
		<td $ar>Phone:</td>
		<td>&nbsp;</td>
		<td><input class='text' type='text' name='phone1' value='$phone' size='30'/></td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
		<td><img src='../graphics/contact/captcha-$i.gif' width='185' height='46' alt='Captcha Image'/></td>
	</tr>
	<tr>
		<td $ar>&nbsp;&nbsp;&nbsp;&nbsp;Above word:</td>
		<td>&nbsp;</td>
		<td class='cperror'><input class='text' type='text' name='captcha' size='30'/>&nbsp;&#42;</td>
	</tr>
      <tr>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
            <td $al class='cperror'>&#42;&nbsp;INCORRECT WORD ENTERED. PLEASE TRY AGAIN.
            </td>
      </tr>
	<tr>
		<td $vat $ar>Message:</td>
		<td>&nbsp;</td>
		<td>
		<textarea rows='5' name='comments1' cols='24'>$comments</textarea>
		</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
		<td>
		<input type='submit' value='Send' name='submit'/>
		</td>
	</tr>
</table></form>
		</td>
	</tr>
	<tr>
		<td class='tagline'>&nbsp;</td>
		<td class='baseline' valign='bottom' align='center'>She! &copy;2010 Christine Jacquemin | Website &copy;2010 <a class='hidden' href='http://www.didymus.org.uk/contact/index.php' title='Want a website like this? Click here to contact the designer.'>Kris Didymus</a></td>
	</tr>
</table>
</div>
</body>

</html>";
exit;}

?>

Re: Autoresponder - capitalisation

Posted: Sat Sep 18, 2010 5:12 pm
by josh
I can't find where it says "Dear" in the message template... is it messed up in the email subject? Create as simple of a script as you can to reproduce it, and post it back. Thanks, chances are I'll then tell you to forward that to your host and debug it (if its deemed to be a server issue). If I can find a bug in your code then I'll let you know too.

Re: Autoresponder - capitalisation

Posted: Sun Sep 19, 2010 6:54 am
by kdidymus
Ah. Yes. I guess the AUTO-RESPONDER code might be of use to you..
<html>
<head>
<style type="text/css">
p.capitalize {text-transform: capitalize;}
</style>
</head>
<body><a href="http://www.beautybyshe.co.uk">
<img src="http://www.beautybyshe.co.uk/graphics/maillogo.jpg" border="0" width="279" height="75" alt="She! Beauty Therapy - Because She is fabulous!"/></a><font face="Calibri, Verdana, Arial, sans-serif"><br/><br/>
THIS IS AN AUTOMATED RESPONSE - PLEASE DO NOT REPLY
<p class="capitalize">Dear %from%,</p>
Thank you for getting in touch with She!<br/><br/>Your e-mail has been received and will enjoy our full attention shortly. We aim to respond to all e-mails within twenty four hours but during busy periods it may take a little longer.<br/><br/>Rest assured that we value your custom, appreciate your patience and will move heaven and earth to be in touch with you as soon as we can.<br/><br/>
Kindest regards.<br/><br/>Christine Jacquemin<br/>Beauty Therapist<br/>She!</font>
</body>
</html>
Perhaps the %from% variable can't be capitalised. If so, is there a way of extracting it first?

Re: Autoresponder - capitalisation

Posted: Sun Sep 19, 2010 4:58 pm
by josh
This is just HTML text. I'm assuming this gets run through a sprintf() function somewhere? Where is that happening. Where is this template utilized?

Re: Autoresponder - capitalisation

Posted: Mon Sep 20, 2010 3:20 pm
by kdidymus
To be honest Josh, I'm at a loss. I've been backwards and forwards with Pickaweb for several days.

They INSIST that when they test my contact form that it works (i.e. the %from% value is capitalized) but it doesn't work for me and I fail to see how it could possibly work at my end. I suspect this is something in the configuration of their server.

I think I'll just have to put up with this irritating (but largely unimportant) glitch as I'm getting nowhere with my host.

Thanks anyway for your help. It's truly appreciated.