0

私は今日、メーラー php の最初のアプリケーションを実行しました。

しかし、記録を残すために、別のメールに移動するためにメールのコピーが必要ですが、添付ファイルはありません。

これを達成する方法を教えてください??

ここにコード(編集、申し訳ありません)

フォーム html:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Contact Form</title>
<meta name="Generator" content="Alleycode HTML Editor">
<meta name="Description" content="Your description here...">
<meta name="Keywords" content="Your keywords here...">
</head>
<body>
<form method="post" action="sendmail2.php">
<p>
<label>Name:</label> <br/> <input type="text" name="name" size="48" height="40"/>
</p>
<p>
<label>Email:</label> <br/> <input type="text" name="email" size="48" height="40"/>
</p>
<p>
<label>Child's Name:</label> <br/> <input type="text" name="childname" size="48"    height="40"/>
</p>
<p>
<label>Site:</label>
<br/>
<textarea name="site" rows="2" cols="45" overflow:hidden>xx.com.au</textarea>
</p>
<p>&nbsp;</p>
<p>
<label>Days:</label>
<br/>
<textarea name="days" rows="2" cols="45" overflow:hidden>Monday, Tuesday, Wednesday,  Thursday, Friday</textarea>
</p>
<p>&nbsp;</p>
<p>
<input type="submit" value="Send"/>
 <a href="xx/form.html">clear</a></p>
 </form>
 </body>
 </html>

sendmail2.php:

<?php
require("../phpmailer/class.phpmailer.php");
include("email.php");
$name = $_POST['name'];
$childname = $_POST['childname'];
$site = $_POST['site'];
$days = $_POST['days'];
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = "xxx.com"; // SMTP servers
$mail->Username = "xxx";   // SMTP username
$mail->Password = "xxx"; // SMTP password
$mail->AddAddress($_POST['email']);
$mail->From     = "xxx@ax.com.au";
$mail->FromName = "xxx_online";
$mail->Subject = "Message from Alouette";
$mail->IsHTML(true);
$mail->Body = $message;
$mail->AddAttachment("../attachs/x.pdf");
$mail->AddAttachment("../attachs/xd.pdf");
if($mail->Send()) {
echo "Message sent! Thanks !          ";
print('<a href="xu/mail/form.html">Reset and Back</a>');
} 
?>

メール.php

<?php
$message = '
Hello  '.$name.', <br/>
we have received your interest in child care services for  '.$childname.' from the    '.$site.' website. <br/>
<br/>
 '.$days.' 
<br/> <br/>
Should you have any questions regarding the information on our enrolment form or  services please do not hesitate to contactkkk
<br/> <br/> <br/>

Regards, <br/>


<a href="mailto:x@x.com.au">x@nx.com.au</a>   &nbsp;&nbsp;&nbsp;  <a   href="http://www.nx.com.au" target="_new">www.neo-it.com.au</a> 
<br/> 
<strong>Childcare Management Services</strong>
<br/> <br/>


    '
    ?>

どうもありがとう!

4

2 に答える 2

0

私はphpFreaksの助けを借りてこのようにしました

とてもシンプル!フリークに感謝します!

于 2011-01-25T04:10:58.610 に答える
0

PHP で単純なメールを送信するには、以下が必要です。

  • 受信者の電子メール ID
  • 主題
  • メッセージ
  • ヘッダー

multipartファイルを添付するには、 Content-Typeを使用する必要があります

したがって、必要な変数を受け入れ、2 つのメールを送信するカスタム関数を作成できます。1 つはファイルが添付されたメールを送信する場所で、もう 1 つはレコード管理のために添付ファイルなしで別の電子メール ID に送信します。

于 2011-01-20T11:38:02.100 に答える