PDA

View Full Version : Question about PHP form mailer from this site


dwalker101
10-03-2007, 02:39 PM
Hi
I am a DW beginner, former FP user. First I want to say thank you for such a great site and forum and thank ramandeep for the PHP script.

FP has its faults, but it made great contact forms that worked well. Since I plan on switching completely to DW, I have many many many websites that I have made for clients that will need to use PHP for the form results. I have been searching for an easy beginner type of form that I can understand and I want to try the script from here this afternoon but I have a question before I start. I searched a long time through all the threads regarding forms, I saw 2 that mentioned uploading the php files to the HTDOCS folder. I logged in to one of my sites via CPanel and saw nothing like this. Am I looking in the wrong place or can anyone help me find where that folder is?

Thanks for your help. I'm sure as I plug along I will have lots more questions. I am using DW CS3 and my host does support PHP.
Debbie

dwalker101
10-03-2007, 07:23 PM
Well - I got the form results to come to my ISP email, but I cannot get them to work in hotmail. Is there anything I can do about that? Thanks!

dwalker101
10-04-2007, 04:44 PM
I'm still looking for possible fixes to send form results to hotmail email accounts with this php script. Does anyone know? Thanks.

edbr
10-05-2007, 01:03 AM
have you checked our bulk/ junk mail folders in hotmail. It is a pain that hotmail treats many e mails as junk when sent via mail

dwalker101
10-05-2007, 01:09 AM
Thanks for asking though.

Is there like a line of code to insert in that php to make this work? Or I guess I can just ask the clients that use hotmail to switch to something else. It also has me wondering if there are other email addresses that may not work. Guess I should try a few out on some people. Another designer friend told me about a month ago that it's just the way it is with the forms - some emails work and other don't, and I have been searching for a long time for something that works in hotmail. :(

domedia
10-05-2007, 02:42 AM
This is 100% dependent on how the email is actually generated. Hotmail has no idea that the email was generated by the form.

dwalker101
10-05-2007, 11:41 AM
I don't understand - sorry. I guess the best thing to do is have my clients switch from hotmail. Thanks

domedia
10-05-2007, 12:39 PM
Wish we could help more, but you're not providing anything to troubleshoot, so it's difficult.

dwalker101
10-05-2007, 12:57 PM
When I have my regular email address in the 2nd line and test it, I get the results immediately at that email, but when I change the 2nd line to my hotmail email address to test, I don't receive anything at hotmail. That is the only problem I am having, otherwise the form was working perfectly. That is why I was asking about hotmail and thought maybe someone else on the forum used hotmail and knew what was going on.

Here is the code used for the php script which I also edited for this post.

<?php
//--------------------------Set these paramaters--------------------------
// Subject of email sent to you.
$subject = 'Results from Contact form';
// Your email address. This is where the form information will be sent.
$emailadd = 'me@hotmail.com';
// Where to redirect after form is processed.
$url = 'http://www.mysite.org/thankyou.htm';
// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req = '0';
// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>

domedia
10-05-2007, 01:07 PM
<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">
You're having the email automatically open another webpage? If so, no wonder hotmail or other webmail services will block it. :-/

dwalker101
10-05-2007, 01:11 PM
ok. That is what is in the script I copied from here. Do I need to change that to something else? Thanks

domedia
10-05-2007, 02:19 PM
I looked into it and realized that was the redirect after the email was sent.

dwalker101
10-05-2007, 03:37 PM
Thanks for checking that out. It must be something with hotmail then. Do you think it is ok to ask the person that made the script? I would be glad to pay for his time.:-D

domedia
10-05-2007, 11:19 PM
Email doesn't really work like that. It's not depended on the script that hotmail alone will get it or not. I would test in hotmail. If you don't have a hotmail account, get one, and check to see if it get's placed in your spam folder or not. I know it can be frustrating when something does not work, but I think you can exclude the script itself, it just generates the email. If it's getting sent elsewhere, it will also be sent to Hotmail.

dwalker101
10-06-2007, 02:49 AM
I did all that earlier and no luck and am going to just start all over again from scratch and see what happens.

Thanks for your help.