Jump to content

PHP mail function


tech-php

Recommended Posts

Hey there all !

 

I want to execute php script in the body of an email..

Is there any specific content type to be include in header ?

 

 

like..

 

include "www.xyz.com";  >> i want this line to be executed inside email

$headers  = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

 

mail("[email protected]",$subject,$body,$headers);

 

-----------------------------------------------------------------------------

I tried ..

$body = "include \"www.xyz.com\";" ;

But it displays........ include "www.xyz.com" ; .......inside the mail

 

Can anyone Help?

Tanks in advance  :)

Link to comment
https://forums.phpfreaks.com/topic/47847-php-mail-function/
Share on other sites

<?php
$body = file_get_contents("http://www.xyz.com");  // i want this line to be executed inside email
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

mail("[email protected]",$subject,$body,$headers);
?>

 

Try that.

Link to comment
https://forums.phpfreaks.com/topic/47847-php-mail-function/#findComment-234197
Share on other sites

Send HTML MIME Mails and in that HTML mail use a frame/ iframe that will point to your php page. To send HTML MIMI Mail You can use this class

http://zigmoyd.sourceforge.net/man/mail.phpJust make a email body that contains HTML tags (e.g. frameset or iframe). and it will set its MIME Type to text/plain automatically.

Link to comment
https://forums.phpfreaks.com/topic/47847-php-mail-function/#findComment-234202
Share on other sites

Or, you could do what I said in the first place, and use cURL or the snoopy library (which is cURL, but simplifies it) and save the contents of the page as $body, then make $body the body of your email, just like I said.  Don't execute the cURL in the email, get the page code, then send it as HTML.

Link to comment
https://forums.phpfreaks.com/topic/47847-php-mail-function/#findComment-234274
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.