Using Phpmailer for sending email with attachment but without using User and Password

Asked

Viewed 611 times

1

That was the only way I could do it. When I take out the SSL setting it does not send. I wanted a way that I didn’t use SMTP, you can 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";`

1 answer

3

Substitute:

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

for:

$mail->IsMail(); 

and ready, but in order to test using the mail method you must have your file hosted on a server with php support.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.