Send email template with file_get_contents in wordpress

$body = file_get_contents(WP_CONTENT_DIR . '/themes/theme-name/emailtemplate.html'); 
$body = str_replace("#name#",$_POST['name'],$body);
$body = str_replace("#email#",'<a style="color:#fff" href="mailto:'.$_POST['email'].'">'.$_POST['email'].'</a>',$body);
$body = str_replace("#mobile#",$_POST['mobile'],$body);
$body = str_replace("#message#",$_POST['message'],$body);

$to = "[email protected]";
$headers = 'From: "' . $name. '" <[email protected]>' . "\r\n";
$headers .= "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=UTF-8" . "\r\n";

mail( $to, $subject, $body, $headers );

Post a comment

Your email address will not be published.


  1. Santossep

    https://zithromaxproff.com/# generic zithromax 500mg
    zithromax buy online no prescription

  2. BillyBom

    buy sumycin online: order terramycin online
    generic myambutol

  3. MichaelDiund

    prescriptions from india: order medications online from india india pharmacies online

  4. MichaelDiund

    usa pharmacy india: meds from india best india pharmacy

  5. Robertcooto

    ed meds: https://edpillsonline24.com/# ed pills for sale

  6. Michaelgox

    viagra from india: buying viagra online without prescription viagra without a doctor prescription canada

  7. Michaelgox

    viagra amazon: viagra prescription viagra without a doctor prescription usa

  8. Claudaluck

    amoxicillin 500mg price: buy amoxicillin – 875 mg amoxicillin cost

  9. Claudaluck

    doxycycline 50 mg: doxycycline – 100mg doxycycline

  10. Claudaluck

    buy clomid: buy clomid – no prescription clomid

  11. Claudaluck

    amoxicillin 500 mg cost: generic amoxil – amoxicillin 500mg capsules price

  12. ThomasMom

    fincar: propecia for sale – propecia cost
    tadalafil generic cost

  13. ThomasMom

    ventolin inhaler non prescription: ventolin for sale – buy ventolin pills online
    tadalafil pills

  14. ThomasMom

    rx coupon ventolin: albuterol without dr prescription usa – buy ventolin tablets uk
    buy tadalafil

  15. ThomasMom

    purchase finasteride without a prescription: propecia – propecia tablets
    tadalafil without a doctor’s prescription

  16. Victordiame

    canadapharmacyonline ed drugs – best online foreign pharmacies
    online pharmacy in germany

  17. WalterHoath

    buy cialis philippines: ed drugs – much does cialis cost without insurance

  18. Russelllox

    viagra 100mg viagra 100mg – viagra without a doctor prescription

  19. Russelllox

    cost of viagra buy generic viagra online – generic viagra without a doctor prescription

  20. Russelllox

    viagra without doctor prescription online viagra – viagra generic

  21. Russelllox

    buy generic viagra online buy viagra pills – free viagra

  22. WilburfaB

    п»їhow much does cialis cost with insurance: cheapest generic cialis australia taking cialis soft tabs
    buy cialis online in canada

  23. WilburfaB

    buy cialis without perscription: can i buy cialis online buy cialis in miami
    buy cialis tadalafil tablets

  24. WilburfaB

    cialis for daily use: buy cheap cialis uk buy cialis online overnight
    cialis sale 20mg

  25. WilburfaB

    canada cialis online: buy cialis rush cialis 5mg tablet
    where can u buy cialis

Existing contact updated. array(0) { }