duanqiechui2378 2013-09-17 05:38
浏览 6

如何使用PHP将填好的表单邮寄到电子邮件地址?

I am trying to send a filled up form to a particular email address. But I have no Idea about it. I know a little PHP coding and as far I have studied online I found that PHP already have a mail() function. but that also have some problems. although most of that I did not understood properly.

here is the things I want to do:

  1. I want to send the filled up form to the particular email address.
  2. I want to send that filled up form to my mobile phone so that i can reply immediately.
  3. I want to send that mail to my inbox only (not spam pr junk).

I am requesting everyone to give me a details information about how I can do so.

thanks in advance..

  • 写回答

3条回答 默认 最新

  • dongshi6710 2013-09-17 05:47
    关注

    Use PHPMailer to send mails in PHP

    http://phpmailer.worxware.com/

    PHPMailer wiki page:

    https://code.google.com/a/apache-extras.org/p/phpmailer/wiki/UsefulTutorial

    Use can use Gmail, Live or any other SMTP server to send mails Code:

    <?php
    
    require("class.phpmailer.php");
    
    $mail = new PHPMailer();
    
    $mail->IsSMTP();  // telling the class to use SMTP
    $mail->Host     = "smtp.example.com"; // SMTP server
    
    $mail->From     = "from@example.com";
    $mail->AddAddress("myfriend@example.net");
    
    $mail->Subject  = "First PHPMailer Message";
    $mail->Body     = "Hi! 
    
     This is my first e-mail sent through PHPMailer.";
    $mail->WordWrap = 50;
    
    if(!$mail->Send()) {
      echo 'Message was not sent.';
      echo 'Mailer error: ' . $mail->ErrorInfo;
    } else {
      echo 'Message has been sent.';
    }
    

    ?>

    评论

报告相同问题?

悬赏问题

  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c