1
neda_barna
send email with attach file
  • 2008/1/28 12:28

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


hi
i want send email with attach file
please see my code and said me my problem
this code send email with attach file
but when i check my email
said to me this file didnt scan
and when i save a file i cant open that
$to $email;
              
$from "John-Smith ";
              
$subject "Here is your attachment";
  
  
$fileatt "/home5/modules/referee/upload/ABSTRACT-2007-08-27-824925.PDF";
              
$fileatttype "application/pdf";
              
$fileattname "newpaper.pdf";

              
$headers 'From: 4hncce 

              
$file fopen$fileattname'rb' );
 
              
$data fread$filefilesize$fileatt ) );
  
              
fclose$file );
  
              
$semi_rand md5time() );
 
              
$mime_boundary "==Multipart_Boundary_x{$semi_rand}x";

              
$headers .= "nMIME-Version: 1.0n" .
 
                          
"Content-Type: multipart/mixed;n" .
                          
" boundary="{$mime_boundary}"";
 
                          
$message ="hi all it is for you";

              
$message .= "This is a multi-part message in MIME format.nn" .

                      
"--{$mime_boundary}n" .
 .
                      
"Content-Type: text/plain;  charset="iso-8859-1"n" .
                      
"Content-Transfer-Encoding: 7bitnn" 
                      
$message "nn";
  
              
$data chunk_splitbase64_encode$data ) );
  
              
$message .= "--{$mime_boundary}n" .
  
                       
"Content-Type: {$fileatttype};n" .
 
                       
" name="{$fileattname}"n" .
  
                       
"Content-Disposition: attachment;n" .
  
                       
" filename="{$fileattname}"n" .
                   
"Content-Transfer-Encoding: base64nn" .
  
                       
$data "nn" .
                     
"--{$mime_boundary}--n";
  
                      
                       if( 
mail$to$subject$message$headers ) ) {
  
                  echo 
"

The email was sent.

"
;
 
              }
 
              else {
  
                  echo 
"

There was an error sending the mail.

"
;
  
              }

2
neda_barna
Re: send email with attach file
  • 2008/1/29 5:03

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


no one cant help me

3
neda_barna
Re: send email with attach file
  • 2008/1/29 5:05

  • neda_barna

  • Just popping in

  • Posts: 63

  • Since: 2007/9/5 4


no one cant help me

4
joninzar
Re: send email with attach file
  • 2008/2/29 12:13

  • joninzar

  • Just popping in

  • Posts: 12

  • Since: 2006/11/7


Look at this.

http://phpmailer.codeworxtech.com/

It's a class for sending email.
It isn't very difficult to use.

The class is integrated into Xoops, but I don't know a module for XOOPS which use that.

Regards

Login

Who's Online

342 user(s) are online (267 user(s) are browsing Support Forums)


Members: 0


Guests: 342


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits