I'm working on a PHP MYSQL project Job board which requires me to upload or save CV into database.
I would like to attach text from a textarea (CV) field to an email and send to user.
How can I attach textarea text as a doc and send it with email?
I'm working on a PHP MYSQL project Job board which requires me to upload or save CV into database.
I would like to attach text from a textarea (CV) field to an email and send to user.
How can I attach textarea text as a doc and send it with email?
Grab the CV from the database and save to tmp folder. Use a mail library such as PHPMailer or Swift Mailer to compose and add the attachment.
Using one of these email libraries greatly simplifies the process. For instance, using PHPMailer, sending an email would comprise:
$mail = new PHPMailer();
$mail->Host = 'localhost';
$mail->From = 'my@email.com';
$mail->Mailer = 'smtp';
$mail->Subject = 'A Subject';
$mail->Body = 'Here\'s the CV!';
$mail->AddAddress('someones@email.com');
$mail->AddAttachment('/tmp/cv.zip', 'cv.zip');
$mail->Send();