Using PHPMailer to send email with attachment but without using User and Password

1

That was the only way I could do it. When I take the SSL configuration it does not send. I wanted a form that did not use SMTP, can you help me?

My code so far:

require("phpmail/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();                        
$mail->Host = '';         
$mail->SMTPAuth = true;   
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
$mail->Username = '[email protected]';
$mail->Password = 'senha';
$mail->From = '[email protected]';
$mail->FromName = 'Fale conosco';
$mail->AddAddress($destinatario);
$mail->IsHTML(true); 
$mail->Subject = "Fale conosco";'
    
asked by anonymous 03.11.2014 / 14:01

1 answer

3

Replace:

$mail->IsSMTP();                        
$mail->Host = '';         
$mail->SMTPAuth = true;   
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
$mail->Username = '[email protected]';
$mail->Password = 'senha';

by:

$mail->IsMail(); 

and you're done, but in order to test using the mail method you should have your file hosted on a server with php support.

    
03.11.2014 / 16:30