473,396 Members | 2,037 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Php mailer won't send attachments

When I send mail then all information wes sand but the attached file was not sent? I don’t know why? maybe my coding have some problem.

The code is
Expand|Select|Wrap|Line Numbers
  1. <table width="923" height="372" border="0">
  2. <form name="form1" method="post" action="#" enctype="application/x-www-form-urlencoded" onSubmit="return ValidateForm()" style="margin:0px">
  3.                          <?php
  4.                 $to="wasim1429@yahoo.com";
  5.                 $subject="Mail from site - tckgbookkeeping.biz - Opportunities  Pages";
  6.                 $from="$email";
  7.  
  8.                 //request value from form
  9.                 $name=$_POST['name'];
  10.                 $com_name4=$_POST['ltr'];
  11.                 $email=$_POST['email'];
  12.                 $con_no=$_POST['contact'];
  13.                 $attached=$_POST['cv'];
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.                 $allContent="Full Name : ".$name."\n\n";
  21.                 $allContent.="E_Mail : ".$email."\n\n";
  22.                 $allContent.="Subject  : ".$con_no."\n\n";
  23.                 $allContent.="Message : ".$com_name4."\n\n";
  24.                 $allContent.="Download Attached File : ".$attached."\n\n";
  25.  
  26.  
  27.                 if($name!="" && $com_name4!="" && $con_no!="" && $email!="" && $attached!="")
  28.                 {
  29.  
  30.                     if(!@mail($to,$subject,$allContent,"From:$from"))
  31.                     {
  32.                         $confirmation="Sorry, there was a problem sending your message.Please try later.";
  33.                     }
  34.                     else
  35.                     {
  36.                         $confirmation="Your message has been sent. Thank you for your feedback.";                
  37.                     }
  38.                 }
  39.                  ?>
  40.                          <h4>
  41.                            <?=$confirmation?>
  42.                          </h4>
  43.                          <tr>
  44.                            <td width="114" height="44"><h3> Name: </h3></td>
  45.                            <td width="167"><input name="name" type="text"/>
  46.                              <span class="ster"> *</span> </td> 
  47.                          </tr>
  48.                          <tr>
  49.                            <td height="82"><h3> Email : </h3></td>
  50.                            <td><input name="email" type="text"/>
  51.                              <span class="ster">*</span></td>
  52.                          </tr>
  53.                          <tr>
  54.                            <td><h3> Subject : </h3></td>
  55.                            <td><input type="text" name="contact"> <span class="ster">* </span> </td>
  56.  
  57.                          </tr>
  58.  
  59.                          <tr>
  60.                            <td height="130"> <h3> Message </h3></td>
  61.                            <td valign="top"><textarea name="ltr" cols="60" rows="7"></textarea>  </td>
  62.  
  63.                          </tr>
  64.  
  65.                          <tr>
  66.                            <td height="42"> <h3> Resume </h3></td>
  67.                            <td valign="top"><input name="cv" type="file" class="button" /> 
  68.                            </td>
  69.  
  70.                          </tr>
  71.  
  72.                          <tr>
  73.                            <td height="36">&nbsp;</td>
  74.                            <td valign="top"><input name="submit" type="submit" class="button" value="Submit" />
  75.                                <input name="reset" type="reset" class="button" value="Reset" />
  76.                            </td>
  77.                        </form>
  78.               </table>

Can any body solve my problem pleas …..?

Why attached file was not sand pleas check this…………?
Jun 5 '11 #1

✓ answered by johny10151981

Several Issue,
1: you didnt download the target CV, its not saved in your server yet.
2. Sending a attach file in mime is different.

you can attach file in two different way.
1. Not attaching. Just create a link from your server(not very smart I believe)
2. Attach the file as base_64 Encoding.

1 2509
johny10151981
1,059 1GB
Several Issue,
1: you didnt download the target CV, its not saved in your server yet.
2. Sending a attach file in mime is different.

you can attach file in two different way.
1. Not attaching. Just create a link from your server(not very smart I believe)
2. Attach the file as base_64 Encoding.
Jun 7 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Bill | last post by:
I am trying to have the capability to email attachments. Specifically I want to be able to email a specific attachment that I name that may be a PDF document, text doc, etc. I already have a...
40
by: ian | last post by:
Hi, I'm a newbie (oh no I can here you say.... another one...) How can I get Python to send emails using the default windows email client (eg outlook express)? I thought I could just do the...
2
by: tvmaly | last post by:
Due to the restrictions I have at my host, I cannot use smtplib in my email cgi script. They gave me a script they use that calls nullmailer-inject. I am trying to figure out how to add the...
12
by: Arno R | last post by:
Hi all, This is a repost of a message posted at october 6. The answer I got was about MapiMessages.AttachmentIndex. I think I need the MSMAPI32.OCX to use this. (I don't have this file on my PC)...
5
by: mimi | last post by:
Hi, I've been searching all the posts and articles but couldn't find any example on how to send attachments with pop3 using C#. Does anyone have one or know how? Thanks
0
by: Martin | last post by:
Hi I have a small console app which runs in a loop waiting every 5 mins at some point it needs to send mail, so I have the routine which sends mail. I have Norton Antivirus and only when I end the...
1
by: mike11d11 | last post by:
If someone could help me, I need to be able to send attachments from my access database that I have created. This database runs queries then generates a report off the queries from underlying...
0
by: bambi | last post by:
I am facing issues while adding attachments in an E-mail via Mapisend. The code I use is below. If I try to send , I am getting error messgae in Mailmessage.12. Mailmessage.12 is expected as numeric,...
2
by: palanisiva | last post by:
Hi, I am using PHP mailer to send out 2 different emails. The problem I am having is only the first email is ever sent out. Below is my code. The first email $to but i add two mail id mail not...
4
by: luke noob | last post by:
This is my HTML... <head> <script type="text/javascript" src="js/jquery-1.2.6.pack.js"></script> <script type="text/javascript" src="js/script.js"></script> </head> <body>
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.