duanpiangeng8958 2017-06-28 05:15
浏览 16

我在哪里将发送到我的联系表单的此代码的电子邮件?

Where does my send to email go on this form?

<!--Start Contact form -->                                                      
<form action="email/" method="post" name="enq" target="_blank" onsubmit="return validation();">
  <fieldset>

    <input type="text" name="name" id="name" value=""  class="input-block-level" placeholder="Name" />
    <input type="text" name="email" id="email" value="" class="input-block-level" placeholder="Email" />
    <textarea rows="11" name="message" id="message" class="input-block-level" placeholder="Comments"></textarea>
    <div class="actions">
    <input type="submit" value="Send Your Message" name="submit" id="submitButton" class="btn btn-info pull-right" title="Click here to submit your message!" />
    </div>

    </fieldset>
</form>                  
            <!--End Contact form -->
  • 写回答

1条回答 默认 最新

  • dongtiannai0654 2017-06-28 05:59
    关注

    You can use the PHP built-in mail() function for sending emails to one or more recipients dynamically from your PHP app either in a plain-text form or formatted HTML.

    The basic syntax of the mail() function is as follows;

    mail(to, subject, message, headers, parameters)
    

    Easiest way to send emails from php

    <?php
        $to = 'xyz@somedomain.com';
        $subject = 'This is subject';
        $message = 'This is email message'; 
        $from = 'sendermailadd@email.com';
    
        // Sending email
        if(mail($to, $subject, $message)){
            echo 'Your mail has been sent successfully.';
        } else{
            echo 'Unable to send email. Please try again.';
        }
    ?>
    

    for further explained details please refer tutorialspoint.com


    Please note that the PHP mail() function is a part of the PHP core but you need to set up a mail server on your machine to make it really work.

    How to configure XAMPP to send mails from localhost Read From here

    评论

报告相同问题?

悬赏问题

  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助
  • ¥15 STM32控制MAX7219问题求解答