Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions phpassignment2/mail.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

//This assignment shows how to send emails from php scripts
//php mail function enable us to send mail,htmlfile,attachemnt with message

ini_set("sendmail_from", "youusername@gmail.com");

$to = "xyx@lnmiit.ac.in";//change receiver address

$subject = "Mail send from php script";
$message = "This is my assignment.";
$header = "yourusername@gmail.com \r\n";

$result = mail($to, $subject, $message, $header);

//mail function has four parameters
//1)mail address of reciever
//subject of mail
//messasge the reciver wil get
//header

if ($result == true) {

echo "Message sent successfully...";
} else {
echo "Sorry, unable to send mail...";
}

?>
1 change: 1 addition & 0 deletions phpassignment2/mail.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Create a Simple php script to send email.