Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include_once(serverpath."includes/functions/phpmailer/class.phpmailer.php");
- include_once(serverpath."includes/functions/phpmailer/class.smtp.php");
- $mail = new PHPMailer();
- $mail->PluginDir = serverpath.'includes/functions/phpmailer/';
- $mail->SetLanguage( 'es', ''.serverpath.'includes/functions/phpmailer/language/' );
- $mail->CharSet = "UTF-8";
- $mail->From = $from;
- $mail->FromName = $from_name;
- $mail->AddAddress($to);
- $mail->Subject = $subject;
- $mail->Body = $message;
- $mail -> IsHTML (true);
- if (!empty($attachment))
- {
- foreach ($attachment as $value)
- $mail->AddAttachment($value);
- }
- if ($type==0) //SMTP
- {
- $mail->IsSMTP();
- $mail->Mailer="smtp";
- $mail->SMTPAuth = "1";
- $mail->Username = $smtp_user;
- $mail->Password = $smtp_pass;
- $mail->Host = $smtp_host;
- }
- elseif ($type==1) //Funcion mail
- {
- $mail->IsMail();
- $mail->Mailer="mail";
- }
- if ($mail->Send()) return true;
- else {
- echo $mail->ErrorInfo;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement