Attachment emai

Hanamichi Sakuraghi · Dec 4, 2012
ko mo tny, gmn cara menambah file attachment pada mailer autoresponder
 form1
 <form id="affiliate_create_form" method="post" action="pro1.php" style="margin:0;padding:0;" >
    <div class="title">
	<div class="text">
	    
	</div>
    </div>

    
				
    <div class="description">
	<div class="text">
	   
	</div>
    </div>

    <table class="basic_form" align="center">
	<tr class="important">
	    <td class="required">Full Name</td>
	    <td><input name="name" type="text" style="width:240px;" value=""></td>
	</tr>
																						
	<tr>
	  <td class="required">Email Address</td>
	  <td><input type="text" name="email" value=""></td>
	  </tr>
		
	<tr>
	  <td></td>
	  <td><button type="submit">Continue</button></td>
	  </tr>

    </table>

    <script>
	//document.getElementById('country').value = "";
    </script>

</form>
<?php
 include("affiliates/connect.inc.php");

 
 $regUsid = md5(uniqid(rand()));
 $regUser = $_POST['name'];
 $regMail = $_POST['email'];
 //sample
	$fileatt = $_FILES['fileatt']['tmp_name'];
	$fileatt_type = $_FILES['fileatt']['type'];
	$fileatt_name = $_FILES['fileatt']['name'];
 //end of sample
 $qUser = mysql_query("SELECT * FROM user_subcribe WHERE Name='$regUser'");
 $qMail = mysql_query("SELECT * FROM user_sub WHERE email='$regMail'");

 $nUser = mysql_num_rows($qUser);
 $nMail = mysql_num_rows($qMail);
 
 if($nUser == 0 && $nMail == 0){
  $tujuan = $regMail;
  $subjek = "Thanks for Comfirming your details- www.healthonlinegroup.com";
  $data_s = "From: support@healthonlinegroup.com"."Reply-To: support@healthonlinegroup.com";
  $isi    = "Thank you for your order and confirming your details  \r\n";
  $isi   .= "Attached to this email you will find your guide for yo to read or print straigh away \n";
  $isi   .= "You will also attached your bonouses\r\n";
  $isi   .= "If you have any problems or questions, please do not hesitate to email me at support@healthonlinegroup.com \r\n";
  $isi   .= "Good luck  with your Conception  and we look foward to hearing your succes  story!\r\n";
  $isi   .= "thanks\r\n";
  $isi   .= "Sarah Jefries\r\n";
  $isi   .= "Customer Service Manager\r\n";
  $isi   .="<a href='e-book/Symfony_cmf_master.pdf'><img  src='e-book/images.jpg' alt='pdf' />e-book1</a>\r\n";
  $isi   .="<a href='e-book/Symfony_cmf_master.pdf'><img  src='e-book/images.jpg' alt='pdf' />e-book1</a>\r\n";
  $isi   .="<a href='e-book/Symfony_cmf_master.pdf'><img  src='e-book/images.jpg' alt='pdf' />e-book1</a>\r\n";
  $atc.='AddAttachment "c:\mydocuments\test.txt"';
  mail($tujuan, $subjek, $isi, $data_s,  $atc);
  
  mysql_query("INSERT INTO user_subcribe(Name, Id) VALUES('$regUser', '$regUsid')");
  mysql_query("INSERT INTO user_sub(Id, email,status) VALUES('$regUsid','$regMail','n')");
  
  echo"<script language='javascript'>window.location='after_thankyou1.html'</script>";
 }
 elseif($nUser>0){
  echo"<script language='javascript'>alert('Username already exist, please pick another username !')</script>";
  echo"<script language='javascript'>window.location='thankyou_confirm4.htm'</script>";
 }
 elseif($nMail>0){
  echo"<script language='javascript'>alert('eMail address already exist, please use another eMail address, or you can contact us if you forgotten your password !')</script>";
  echo"<script language='javascript'>window.location='thankyou_confirm4.htm'</script>";
 }
 else{
  echo"<script language='javascript'>alert('Several error occured !')</script>";
  echo"<script language='javascript'>window.location='thankyou_confirm.htm'</script>";
 }
?>

$isi .="<a href='e-book/Symfony_cmf_master.pdf'><img src='e-book/images.jpg' alt='pdf' />e-book1</a>\r\n"; file ini yang akan di jadikan attachment

thx
Silahkan login untuk menjawab!
0
Loading...
Ellyx Christian · Dec 5, 2012 · 0 Suka · 0 Tidak Suka