douxiong5438 2012-06-10 20:39
浏览 46

如何通过电子邮件发送数据库和表单

I have a website created using PHP to store form values in a database, and have a page that displays the values for certain users based on the selections. I am trying to send these values from the database to an email address, but I can not separate the values on each line of the subject. I am using the PHP built in function to email and storing the values in the subject variable.

I have tried add each variable separately by using

$subject . "content"; 

for each variable but it still is all in one line.

I am now thinking of making a newsletter type, but can't figure out how to make one or make it work how I want. So if anyone could help out on how I can send these values either in this way or in a different language.

Here is the code I have so far.

   $query= sql query
    $resultt= sql result
    $roww=mysql_fetch_assoc($resultt);

    extract($roww);

    $emmessage = "User Form Information";

    $emmessage = $emmessage . "     " . "values extracted from the database from $roww

$send = @$_POST['send'];
$subject = strip_tags(@$_POST['subject']);
$reciever= strip_tags(@$_POST['email']);
$message = $emmessage;

//  Start email processing
if ($send) 
{
//  Send the message
mail($reciever, $subject, $message, "From: $email");
$emessage="Your message has been sent";
include("forme.php");
  • 写回答

2条回答 默认 最新

  • dongsi5381 2012-06-10 20:42
    关注

    You can seperate lines in e-mails using .

    $content = "Value 1 
     Value2";
    
    评论

报告相同问题?

悬赏问题

  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题