Jump to content

webstar

Members
  • Posts

    26
  • Joined

  • Last visited

Everything posted by webstar

  1. How can i Make this code below grab the 3rd line of the file I am feeding through it and make it the subject line of the email? I'm kinda php dumb and this is likely really simple. #!/usr/bin/php <?php # E-mail recipient(s). Separate each address with a comma and a space. $emailrecip = "REMOVED"; # E-mail subject line. $emailsubject = "REMOVED"; # E-mail From name. $emailfromname = "REMOVED"; # E-mail From address. $emailfromaddr = "REMOVED"; $fp = fopen('php://stdin','r'); $data = ""; while(!feof($fp)) { $data .= fgets($fp,4096); } fclose($fp); $timestamp = "REMOVED"; $timestamp .= date("D, j M Y G:i:s O "); $timestamp .= "\n"; $timestamp .= "Emailed to you at: %EMAILSTAMP%"; $timestamp .= "\n"; # Send the e-mail. $subject = $emailsubject; $recipient = $emailrecip; $body_of_email = $timestamp; $body_of_email .= trim($data); $header = 'From: "' . $emailfromname . '" <' . $emailfromaddr . '>'; $header .= "\n"; $header .= "X-Priority: 1"; $header .= "\n"; mail ($recipient, $subject, $body_of_email, $header); echo ("E-mail sent."); ?>
×
×
  • 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.