Being that you are here, hope you have already gone through part 1 and 2 and now set to continue with the recipients settings. Copy the code below then we go through it step by step. $ mail -> setFrom ( 'vik03@username.ac.ke' , $dept ); it has 2 options, first option is the senders email, second option is the mail header which is optional. $mail->AddAddress($result->EmailId); Add a recipient, you can also add a name as a second option but that is optional, I have stored the recipient in a variable but you can still key it in as a row text. This snippet have the variables used as part of the mail build up, PHP concatenation and conditions have also played a part and trust me the library understands all this. $ mail -> Subject = $msg ; here is where the email subject is written. Since we had already set the email format to HTML above by including this line, $ mail-> isHTML ( true ); we can continue to add the email body now $mail->Body = $body; a...
Home for everything tech related content