How to make PHPMailer send from my own server?

0

I asked the question below and after trying several ways to send email through localhost I got it with PHPMailer:

How to send localhost email using the PHP mail function?

However, I did it through the example for Gmail that is inside the PHPMailer's 'examples' folder.

I would like to know the following, if I build a small website using PHPMailer when I go to host I will have to upload the PHPMailer classes is not it?

I know this is a fairly obvious question, but my concern is whether I can take advantage of the Gmail configured code.

Just change the server and tals?

//Set the hostname of the mail server
$mail->Host = 'smtp.gmail.com';

//Set the SMTP port number - 587 for authenticated TLS, a.k.a.
RFC4409 SMTP   submission $mail->Port = 587;

On these lines will I put the server where I will host my site?

    
asked by anonymous 22.11.2014 / 23:37

1 answer

1

Yes, yes, you can (and it's interesting) to reuse the code.

You only need to edit the parts for the configuration of the sending mail server, as you described in your post.

    
22.11.2014 / 23:52