As hackerone said, to change your code to send with SendGrid and PHPMailer, you'll need to update your code to include SMTP settings after instantiating PHPMailer. The following settings will work with SendGrid:
// This should go somewhere after $mail = new PHPMailer();
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.sendgrid.net'; // Specify server
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'your_sendgrid_username'; // SMTP username
$mail->Password = 'your_sendgrid_password'; // SMTP password
$mail->Port = 587; // Recommended Port
$mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl'