I'm using the phpmailer library. To send an email I need to specify an smtp server, smtp user and smtp password. The problem is I'm using the cloud platform Heroku where I use a github repository to autodeploy to heroku, I don't want my smtp username and password to be public. Is there a way to solve this?
Below is the code snippet
$mail = new PHPMailer(false); // Passing `true` enables exceptions
//Server settings
//$mail->SMTPDebug = 1;//Enable verbose debug output
$mail->isSMTP();//Set mailer to use SMTP
$mail->Host = 'smtp host';//Specify main and backup SMTP servers
$mail->SMTPAuth = true;//Enable SMTP authentication
$mail->Username = 'user';//SMTP username
$mail->Password = 'password';//SMTP password
$mail->SMTPSecure = 'tls';//Enable TLS encryption, `ssl` also accepted
$mail->Port = 587;//TCP port to connect to
//Recipients
$mail->setFrom('example@example.com','myapp');
$mail->addAddress('hi@examle.com');//Add a recipient
//$mail->addAddress('ellen@example.com');//Name is optional
$mail->addReplyTo('support@example.com','Contact');
//Content
$mail->isHTML(true);//Set email format to HTML
$mail->Subject = 'test';
$mail->Body = 'this is a test';
$mail->send();