Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!---- send single email ------------------------->
- $recipient = "info@srimaharajainn.com";
- // Mail subject
- $subject = "Good news! A reservation has been requested by $email";
- // Mail content
- $email_content = "Booking Enquiry from $fname
- /// in mail content show like this
- Arrival: $arrival
- Departure: $departure
- Phone : $phone
- Message: $message";
- // Mail headers
- $email_headers = "From:info@srimaharajainn.com";
- // Main messages
- if (mail($recipient, $subject, $email_content, $email_headers))
- {
- echo "<h1>Email has been sent successfully!</h1>";
- }
- else
- {
- echo "<p>Oops! Something went wrong and we couldn't send your reservation.</p>";
- }
- else
- {
- echo "<p>There was a problem with your submission, please try again.</p>";
- }
- <!------- /// send single email ------------------->
- <!----- bulk email ---------------------------->
- <?php
- if(isset($_POST['frm_chk'])){
- $_Chk_box_value = $_POST['frm_chk'];
- $subject1=$_POST['subject'];
- $message=$_POST['message'];
- echo $to = implode(',',$_Chk_box_value);
- //echo 'Pass this to mail() funtion Recipients : '.$to;
- $recipient = $to;
- // Mail subject
- $subject = $subject1;
- // Mail content
- $email_content = "
- Message : $message
- ";
- // Mail headers
- $email_headers = "From:bnarendra6036@gmail.com";
- // Main messages
- if (mail($recipient, $subject, $email_content, $email_headers))
- {
- echo "<h1>Email has been sent successfully!</h1>";
- }
- else
- {
- echo "<p>Oops! Something went wrong and we couldn't send your reservation.</p>";
- }
- }
- ?>
- <html>
- <body>
- <form name="form1" action="" method="post">
- <!--
- Dynamically You Can Print the Check Boxes here....
- -->
- <input type="checkbox" name="frm_chk[]" value="bnarendra6036@gmail.com" />bnarendra6036@gmail.com<br>
- <input type="checkbox" name="frm_chk[]" value="rajashekar9426@gmail.com" />rajashekar9426@gmail.com<br>
- Subject : <input type="text" name="subject"><br><br>
- Message : <textarea name="message" cols="20" rows="5"></textarea><br><br>
- <!--
- .....With Other Elements
- -->
- <input name="" type="submit">
- </form>
- </body>
- </html>
- <!-------------- //bulk email ------------------------------->
Add Comment
Please, Sign In to add comment