help with phpMailer form

Asked by:
bartonboley@yahoo.com / 34 Points
Time:
2014-01-14 6:20 pm EST
Category:
Dreamweaver
Hits:
1,724
A few day ago you guys lead me to:
http://www.webhostinghub.com/help/learn/email/email-from-web-page/using-phpmailer-to-send-mail

I've tried to paste and configure it into my page, but are having trouble. Please take a look. The form does not send the email and a bunch of the php script is displayed on the page.

I have very little experience with php scipts. Once this issue is overcome, I'll be ready to fill in some content and will be ready to start promoting the site. The form page is:
http://www.drill4waterequipmentleasing.com/get_started_step_5.html

To ask this user for more information, please first login.

To submit an answer, please login.

Simple enough, I've done that and now, in the browser I get:

Parse error: syntax error, unexpected T_STRING in /home/drill45/public_html/get_started_step_5.php on line 95
bartonboley@yahoo.com
34 Points
2014-01-14 06:46 pm EST
I stumbled past the above error by deleting test in line 95 & 96. Now I'm getting the below error that looks like to phpMailer didn't install files in the correct places.

Warning: require(PHPMailer-master/lib/PHPMailer/PHPMailerAutoload.php) [function.require]: failed to open stream: No such file or directory in /home/drill45/public_html/get_started_step_5.php on line 55

Warning: require(PHPMailer-master/lib/PHPMailer/PHPMailerAutoload.php) [function.require]: failed to open stream: No such file or directory in /home/drill45/public_html/get_started_step_5.php on line 55

Fatal error: require() [function.require]: Failed opening required 'PHPMailer-master/lib/PHPMailer/PHPMailerAutoload.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/drill45/public_html/get_started_step_5.php on line 55
bartonboley@yahoo.com
34 Points
2014-01-14 07:10 pm EST
Like I said above, the PHPMailer didn't have a lib folder, so changed the require in line 55 to point to the PHPMailerAutoLoad.php file in the root of PHPMailer-master. I am now getting a different error in the browser. It initially loads the page with:

Message could not be sent.
Mailer Error: Message body empty

When I fill in the to input fields and click submit, in the browser it can't find a page called, http://www.drill4waterequipmentleasing.com/email.php

I can't find that page anywhere on the site. The form does not deliver the email either.
bartonboley@yahoo.com
34 Points
2014-01-14 07:44 pm EST
I've been gone for a while today and are just now getting back to this. I'm guessing the email.php is a generic name that needs to be replaced by the real file name that you use for the site. In the script, I changed it to point to the file name and when you hit submit it just goes back to the page and clears the content of the input fields.

But it still shows at the bottom of the page:

Message could not be sent.
Mailer Error: Message body empty

And the form email is not sent. I would think it should go to a page that says the message was successfully sent. I know I'm close on this and would really appreciate a little help getting over this hump.

Bart
bartonboley@yahoo.com
34 Points
2014-01-15 01:35 am EST

ANSWERS

0

JeffMa
Staff
2,342 Points
2014-01-14 6:35 pm EST
I have noticed that you are attempting to insert PHP code within an HTML file. To allow the file to use PHP within it, you will need to change the file extension from a .html file to a .php file. Currently the file name is:
http://www.drill4waterequipmentleasing.com/get_started_step_5.html

Which will need to be changed to:
http://www.drill4waterequipmentleasing.com/get_started_step_5.php

To submit a comment on this answer, please first login.

Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!
Need More Help?

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 757-416-6627 Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.
}