html - How to send image in PHP mail function -
I want to send the image in the mail. How to add the image so that it will show in the email that I want to add to the image How to use html in the customer message body client message body?
This is my code:
& lt ;? Php / * subject and email varialbles * / $ emailSbuject = 'check'; $ WebMaster = 'vivek@a.com'; $ EmailSbuject2 = 'Thank you'; $ Client = '$ emailfield \ r \ n'; / * Collecting data variable / $ nameFeild = $ _POST ['name']; $ CityFeild = $ _POST ['city']; $ Countryfield = $ _POST ['country']; $ EmailFeild = $ _POST ['email']; $ PhoneField = $ _POST ['Phone']; $ Other field = $ _POST ['other']; $ Questionfile = $ _POST ['question']; $ Comment field = $ _POST ['comment']; $ Phone1Feild = $ _POST ['phone1']; $ Hear 1 Fields = $ _POST ['Sun1']; $ Hear2Feild = $ _POST ['Sun 2']; $ Hearing 3 Fields = $ _POST ['Sun 3']; $ Hear4Feild = $ _POST ['Sun4']; $ Referalfield = $ _POST ['referral']; $ Other Herefield = $ _POST ['second arrow']; // admin message body $ body = & lt; & Lt; & Lt; EOD Contact Form $ nameFeild Name: $ nameFeild \ nCity: $ cityFeild \ nCountry: $ countryfield \ nEmail: $ emailFeild \ nContact Phone: $ phoneFeild \ NOther phones: $ other field \ nQ: $ questionfild \ NNote: $ comment field \ ncontact over: $ phone1 field \ nby known through us: \ n $ hear1Feild $ hear2Feild $ hear3Feild $ hear4Feild $ ReferralFild $AderHalffieldEOD; // Client message body $ body2 = & lt; & Lt; & Lt; EOD Dear $ nameFeild Thank you for contacting IntaxFin One of our representatives will contact you soon if you have more questions or information, please let us know we are happy for your service! \ N- IntaxFin Team \ http://www.intaxfin.com \ n Like us on Facebook \ n Follow us on Twitter \ n Join us on LinkedIn \ n ----------- - ------------------------------------------------- - ----------------------------------- E-mail was sent automatically by the IntaxFin Administration Directory and Is for your reference. Please do not respond to this e-mail address. Powered by Hexdod Technologies Pvt. Ltd. EOD; $ Headers = "to: $ emailFeild \ r \ n"; $ Header = "From: $noreply@intaxfin.com \ r \ n"; $ Success = mail ($ webmaster, $ emailsburg, $ body, $ headers); $ Success1 = @mail ($ emailfile, $ emailbox2, $ body2, $ header); / * Results * / $ theresults = & lt; & Lt; & Lt; EOD EOD; "$ TheResults" echo; Header ("Location: http://www.intaxfin.com/thankyou.html"); Go out; ? & Gt;
You can not display pictures on text / plain email as shown above. You have to send it as text / html.
Then you have to give your headers as follows:
$ header = "From: $noreply@intaxfin.com \ NMIME-version: 1.0 \ nContent- Type: text / html; charset = utf-8 \ n ";
Then you will see the HTML code & lt; Br>
or even & lt; With the html tag, it will need to update your mailbox in place of
\ n
or linebrack. P & gt;
Then you can also include an image tag with the image shown in the email
but will be used to better use
its use Upon doing so, you will be able to include any image in your email without having to download it from any website.
By the way: You should use quotation marks for your $ body and $ body2 values ... $ body = "& Lt;
Comments
Post a Comment