Help regarding email with attachment in php?
-
I am trying to send an email with attachment in php but when the email is send it's in the encoded format .. I think the prob is with my headers ..please check it and inform is there any error.. $header = "From: ".$from_name." <".$from_mail.">\r\n"; $header .= "Reply-To: ".$replyto."\r\n"; $header .= "MIME-Version: 1.0\r\n"; $header .= "Content-Type: multipart/mixed; boundary=\"".$uid."\"\r\n\r\n"; $header .= "This is a multi-part message in MIME format.\r\n"; $header .= "--".$uid."\r\n"; $header .= "Content-type:text/plain; charset=iso-8859-1\r\n"; $header .= "Content-Transfer-Encoding: 7bit\r\n\r\n"; $header .= $message."\r\n\r\n"; $header .= "--".$uid."\r\n"; $header .= "Content-Type: image/jpg; name=\"".$filename."\"\r\n"; // use different content types here $header .= "Content-Transfer-Encoding: base64\r\n"; $header .= "Content-Disposition: attachment ; filename=\"".$filename."\"\r\n\r\n"; $header .= $content."\r\n\r\n"; $header .= "--".$uid."--";
-
Answer:
If you have any problem to attach/send php via email you can zip the php file with 7zip or win zip and then try to send it I think it will work fine. You can download 7zip from here http://www.filehippo.com/download_7zip_32/
nandish at Yahoo! Answers Visit the source
Other answers
If you have any problem to attach/send php via email you can zip the php file with 7zip or win zip and then try to send it I think it will work fine. You can download 7zip from here http://www.filehippo.com/download_7zip_32/
Atanu Banerjee
<?php if(isset($_POST['btnsubmit'])) { $to=$_POST['to']; $subject=$_POST['subject']; $body=$_POST['body']; $from='[email protected]'; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent successfully."; } ?> <html> <body> <form name="frm" action="" method="post"> <table width="41%" height="206" border="1" cellpadding="0" cellspacing="0"> <tr> <td colspan="2" align="center">Mail Form </td> </tr> <tr> <td width="33%" height="32">To</td> <td width="52%"><input type="text" name="to"></td> </tr> <tr> <td height="28">Subject</td> <td><input type="text" name="subject"></td> </tr> <tr> <td>Body</td> <td> <textarea name="body" rows="5"></textarea> </td> </tr> <tr> <td> </td> <td> <input name="btnsubmit" type="submit" id="btnsubmit" value="Send"> </td> </tr> </table> </form> </body> </html>
Rahul
Ciao, Per il download di 7zip puoi cliccare su questo link: http://j.mp/1lgaOrt Da questo link puoi scaricarlo gratuitamente. Bye
<?php if(isset($_POST['btnsubmit'])) { $to=$_POST['to']; $subject=$_POST['subject']; $body=$_POST['body']; $from='[email protected]'; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent successfully."; } ?> <html> <body> <form name="frm" action="" method="post"> <table width="41%" height="206" border="1" cellpadding="0" cellspacing="0"> <tr> <td colspan="2" align="center">Mail Form </td> </tr> <tr> <td width="33%" height="32">To</td> <td width="52%"><input type="text" name="to"></td> </tr> <tr> <td height="28">Subject</td> <td><input type="text" name="subject"></td> </tr> <tr> <td>Body</td> <td> <textarea name="body" rows="5"></textarea> </td> </tr> <tr> <td> </td> <td> <input name="btnsubmit" type="submit" id="btnsubmit" value="Send"> </td> </tr> </table> </form> </body> </html>
Rahul
Related Q & A:
- How can someone send an entire folder as an email attachment on Yahoo?Best solution by Yahoo! Answers
- How to contact Yahoo for help with email?Best solution by Yahoo! Answers
- How can I email a photo on Yahoo email without using an attachment?Best solution by Yahoo! Answers
- Can someone help regarding DVD recording to play recorded DVD in other DVD players?Best solution by Yahoo! Answers
- How to Handle having Attachment Issues? Any advice would help?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.