douguyi3903 2010-09-20 13:03
浏览 18
已采纳

从评论框发送电子邮件

I designed a small website last year in visual web developer. I added a small facility using smtp class, basically it allows people to write comments in a text box and once clicked "send" it sends me an email of whatever they typed.

I am now using cPanel, and there is no .net support from what I can see (I am not using a dedicated server, it's a linux shared hosting), how can I write something like this in such different technology? I dont want to touch my existing CMS as I already have my site fully designed its very simple and functional.

I just need pointing to the right direction please.

  • 写回答

3条回答 默认 最新

  • duanli9569 2010-09-20 13:06
    关注

    You can use PHP:

    <?php
    $to = "someone@example.com";
    $subject = "Test mail";
    $message = "Hello! This is a simple email message.";
    $from = "someonelse@example.com";
    $headers = "From: $from";
    mail($to,$subject,$message,$headers);
    echo "Mail Sent.";
    ?>
    

    You can find even an example with a form @ w3schools

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程