简体   繁体   中英

Need PHP Email Script Solution

Designing forms has always been fun, but getting them to send email on the server side is another story. I have used various email scripts (dynaform,phpmailer, etc), and have experienced a ton of problems.

So here is the site I am working on: Contact On the Right . It is very basic: no validation, no required fields. I simply need anything that is entered to be sent back to me.

Does anyone know of any BASIC PHP form processing scripts, or have a few lines of code that would work here? I'm not a PHP guy, so I am struggling!

Thanks in advance.

I simply need anything that is entered to be sent back to me.

<?php
mail('your@mail.here','Site feedback',implode("\n\n",$_POST));
header("Location: thankyou.html");
?>

you can add this tag into thankyou.html:

<META HTTP-EQUIV="REFRESH" CONTENT="5;URL=http://v2.ztmag.com/livedates.html">

it will get user back in 5 seconds

For simple and hard tasks (it does HTML mail) this library always served me well: PHPMailer

Depending on servers and administrators, sometimes mail() doesn't work. It must be configured to work correctly with smtp or have a sendmail binary installed in the correct path.

PHPMailer, instead, only needs outbound connection trough fsockopen not to be disabled.

A simple tutorial here:
http://www.ustrem.org/en/articles/send-mail-using-phpmailer-en/

A number of CMS uses it internally, too. Joomla, for example.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM