Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3675022
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:55:30+00:00 2026-05-19T02:55:30+00:00

How to send the email with resume attachment , i take snippet from this

  • 0

How to send the email with resume attachment ,

i take snippet from this place Click here

In this site, snippet works fine,

Even i got the mail, but attachment is not working, am getting attment as noname with 0kb

size file, What is Issue in that snippet ,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T02:55:31+00:00Added an answer on May 19, 2026 at 2:55 am
     function mail_attachment($to, $subject, $message, $from, $file) {
      // $file should include path and filename
      $filename = basename($file);
      $file_size = filesize($file);
      $content = chunk_split(base64_encode(file_get_contents($file))); 
      $uid = md5(uniqid(time()));
      $from = str_replace(array("\r", "\n"), '', $from); // to prevent email injection
      $header = "From: ".$from."\r\n"
          ."MIME-Version: 1.0\r\n"
          ."Content-Type: multipart/mixed; boundary=\"".$uid."\"\r\n\r\n"
          ."This is a multi-part message in MIME format.\r\n" 
          ."--".$uid."\r\n"
          ."Content-type:text/plain; charset=iso-8859-1\r\n"
          ."Content-Transfer-Encoding: 7bit\r\n\r\n"
          .$message."\r\n\r\n"
          ."--".$uid."\r\n"
          ."Content-Type: application/octet-stream; name=\"".$filename."\"\r\n"
          ."Content-Transfer-Encoding: base64\r\n"
          ."Content-Disposition: attachment; filename=\"".$filename."\"\r\n\r\n"
          .$content."\r\n\r\n"
          ."--".$uid."--"; 
      return mail($to, $subject, "", $header);
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to send email from Ant Script. here is the code snippet
I send email through Outlook using VB.Net 2005; this is working fine. At the
I would like to send email from an address I control, but currently this
I am trying to send Email from a Java program that I found here
We need to send email from our desktop application using C# 3.5 . The
I want to send email from a Ruby application. Is there a call in
I am trying to send email using Exchange 2007 from a console app using
How can I send email from a Wicket application?
I can't send email to my app users, even though I have the permissions.
I want to send email with an image attachment but the image must not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.