0% found this document useful (0 votes)
69 views2 pages

Sending Email With PHP

This PHP code defines variables for email address, subject, message body, and headers. It then uses the mail() function to send an email with those parameters. If the mail is sent successfully, it echoes a success message. Otherwise, it echoes a failure message.

Uploaded by

MirunaCatiche
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views2 pages

Sending Email With PHP

This PHP code defines variables for email address, subject, message body, and headers. It then uses the mail() function to send an email with those parameters. If the mail is sent successfully, it echoes a success message. Otherwise, it echoes a failure message.

Uploaded by

MirunaCatiche
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Sending Email: sendingemail.

php
!

<!doctype html>
<html>
<head>
<title>My First Webpage</title>

!
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

!
</head>

!
<body>
<div>

!
<?php


$emailTo="";
$subject="I hope this works!";
$body="I think you're great";
$headers="From: rob@robpercival.co.uk";

if (mail($emailTo, $subject, $body, $headers)) {


echo "Mail sent successfully!";

} else {


echo "Mail not sent!";

?>

!
</div>
</body>
</html>

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy