Jump to content

Sending An Email With A Picture Using PHP


refiking

Recommended Posts

How can I send a picture in the email. So far it just sends the code, not what the code is saying to do.  Here is my script as is:

 

<?

$message = "<img src='mia.gif' border='0'>";
$from = "[email protected]";
$headers = "From: $from\n";
$to = "[email protected]";

               if (@mail($to, $subject, $message, $headers)) {

            // Give a success notice
            echo "Message sent.";
            echo "</center>\n";
            echo "</body>\n";
            echo "</html>\n";
            exit;

        // Give an error that message can't be sent
        } else {
            $error = "Sorry, there was an error while trying to send the message - please try again later.";
        }

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.