开发者

PHP E-Mail Form w/Options

开发者 https://www.devze.com 2023-04-10 06:56 出处:网络
I need to include the first co开发者_StackOverflow中文版de (which calls the e-mail from a WordPress options panel) in the second code where it says email@mail.com.I tried to include \" around the code

I need to include the first co开发者_StackOverflow中文版de (which calls the e-mail from a WordPress options panel) in the second code where it says email@mail.com. I tried to include " around the code, but it doesn't seem to work. I also tried to strip slashes, but to no avail.

How I call the e-mail

<?php echo get_option('to_email'); ?>

The relevant part of my contact form:

    if(!isset($hasError)) {

        $emailTo = 'email@mail.com';
        $subject = 'Contact Form Submission from '.$name;
        $sendCopy = trim($_POST['sendCopy']);
        $body = "Name: $name \n\nEmail: $email \n\nComments: $comments";
        $headers = 'From: My Site <'.$emailTo.'>' . "\r\n" . 'Reply-To: ' . $email;

        mail($emailTo, $subject, $body, $headers);


$emailTo = get_option('to_email');

You have to make sure the right files are included (wordpress config files).

0

精彩评论

暂无评论...
验证码 换一张
取 消