can one help me with a code which can send mail with two attachments of either .dox .docx .pdf .jpeg only at once which are already on the server and the link paths were saved in database (MySql)?
For the sake of Mechanism
To:
From:
Subject:
Message:
Check Boxes Of attachments
Am Just a Beginner I only Know How to send Mail We out Attachments like Bellow
<?php
$errors = '';
$myemail = 'admin@mydomain.net'
if(empty($_POST['name']) ||
empty($_POST['email']) ||
empty($_POST['message']))
{
$errors .= "\n Error: all fields are required";
}
$name = $_POST['name'];
$email_address = $_POST['email'];
$message = $_POST['message'];
if (!preg_match(
"/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i",
$email_address))
{
$errors .= "\n Error: Invalid email address";
}
if( empty($errors))
{
$to = $myemail;
$email_subject = "New Mail From: $name";
$email_body = "$message";
$headers = "From: $myemail\n";
$headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers);
//redirect to the 'thank you' page
header('Location: thank-you.html');
}
?>