Developer Guidance
Developer Guidance
Categories
Php

SEND AN EMAIL WITH ATTACHMENT USING PHPMAILER

Sharing is caring!

In this tutorials we SEND AN EMAIL WITH ATTACHMENT USING PHPMAILER

PHPMailer is one of the most popular open source PHP libraries to send emails. PHPMailer have code library by which We can easily and safely send emails.

SEND AN EMAIL WITH ATTACHMENT USING PHPMAILER

What we do in this :

  • We make and design the form
  • Through PHPMailer we send the mail, which have these attribute or fields Subject, Email, Message and Attachment.

ADVANTAGES OF PHPMAILER:

  • It can print various kinds of errors messages, when it fails to send an email.
  • We can send email as Plain text, HTML and multipart batched files.
  • It support SMTP (SSL and TLS).

NOW WE START WITH CODING:-

Index.php

Now we add PHP code to check the condition and send the form on mail

Put this css in index.php

First we download the PHPMailer library through link
https://github.com/PHPMailer/PHPMailer

Mail.php

In above we send normal email IF you want the send the email in php using smtp then add the below code.

How to add these code in the above mail.php

Leave a Reply

Your email address will not be published. Required fields are marked *