Pdf is generating perfectly and also pdf is available with email. Php contact form with pdf attachment sent using php mailer. These parameters are, in order, the email address to send to, the subject of the email, the message to be sent, additional headers you want to include and finally an additional parameter to the sendmail program. Sending along any attachment such as an image is really easy using the php mailer script. Php sending email with an attachment using phpmailer php. In my opinion is the phpmailer class a very stable and flexible email script. In the example script, we will make it simple to send text or html email including any types of files as an attachment like image. The classic email sending library for php php email php library attachment smtp phpmailer tlssupport php lgpl2. A content type tells the web browser or email application how to interpret the text characters in your html or the body of the email.
Using php mailer to send html emails with images github. You only need to call the mail objects addattachment method passing the file location to the argument as a string value. Two primary mime types are important for the role of default types. When using the php mail function with iis 6 on windows server 2003, check your relay settings on the smtp virtual server in iis. A stepbystep guide to sending html email templates using php. Thats very different from the pain of having to configure mime header boundaries, like using pear or the mail function. You will never see any server sending content type. This custom function or php mail attachment script is able to send a plain text email. This tutorial is an extension to my php pdf tutorial. Here is a list of mime types, associated by type of documents, ordered by their common extensions. If you want to send content from a database or web api e. Contribute to phpmailerphpmailer development by creating an account on github.