Jump to content

Recommended Posts

Thanks for the quick reply.

 

I use this code to call the function.

 

share_email_send('jpotter@agne.com','Jay Potter','jpotter@agne.com','message','test','jpotter@agne.com',$t_reserves_path,'test.php') ;

 

and here is the function code, which uses class.phpmailer.php. I hope class.phpmailer.php is a fairly standard class used throughout the PHP world.

 

 

# --------------------

# This function sends an email message based on the supplied email data.

function share_email_send($t_Recipient,$t_FromName,$t_FromAddress,$t_Message,$t_Subject,$t_Recipient2='jpotter@agne.com',$t_path = '',$t_attachment='') {

global $g_phpMailer_smtp;

 

$mail = new PHPMailer;

 

$mail->From    = $t_FromAddress ;

$mail->Sender  = $t_Recipient ;

$mail->cc = 'jpotter@agne.com';

$mail->FromName = $t_FromName ;

$mail->Subject = $t_Subject ;

$mail->Body = $t_Message ;

 

$mail->PluginDir = $t_phpmailer_path;

$mail->Hostname = '127.0.0.1';

$mail->SetLanguage( 'en' );

$mail->IsHTML( false );              # set email format to plain text

$mail->WordWrap = 80;              # set word wrap to 50 characters

$mail->Priority = '3' ;  # Urgent = 1, Not Urgent = 5, Disable = 0

$mail->CharSet = 'utf-8';

$mail->Host    = 'mail.agne.com';

 

$mail->AddAddress( $t_Recipient, '' );

$mail->AddAddress( $t_Recipient2, '' );

 

$t_Message = $t_Message . ' attachment ' . $t_attachment;

 

if($t_attachment != ''){

 

$t_Message = $t_Message . ' tried attachment' ;

 

$mail->AddAttachment($t_path, $t_attachment) ;

 

$t_Message = $t_Message . $mail->ErrorInfo ;

 

}

 

$mail->Body = $t_Message ;

 

# SMTP collection is always kept alive

#

$mail->SMTPKeepAlive = true;

 

if( is_null( $g_phpMailer_smtp ) )  {

# register_shutdown_function( 'email_smtp_close' );

} else {

$mail->smtp = $g_phpMailer_smtp;

}

 

if ( !$mail->Send() ) {

$t_success = false;

} else {

$t_success = true;

}

 

return $t_success;

}

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.