Hi
Got the mail thing working. Given below is the script<cms:form action='' method='post' enctype="multipart/form-data" id='enquiry_form'>
<cms:if k_success >
<h3>Thank you for contacting us!</h3>
<cms:capture into='my_message'>
The following is an email sent by a visitor to your site:
Company Name: <cms:show frm_companyname />
Contact Person: <cms:show frm_contactperson />
Phone: <cms:show frm_phone />
Email: <cms:show frm_email />
Type of Enquiry: <cms:show frm_enquirytype />
Estimate qty: <cms:show frm_qty />
Requirements: <cms:show frm_requirements />
How to contact: <cms:show frm_contacttype />
Design width: <cms:show frm_designwidth />
Design height: <cms:show frm_designheight />
Measurements: <cms:show frm_measurements />
Fabric: <cms:show frm_fabric />
Location: <cms:show frm_location />
Delivery date: <cms:show frm_deliveryday />
</cms:capture>
<cms:php>
require 'PHPMailer/PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'mail.xxx.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username =
'mymail@domain.com'; // SMTP username
$mail->Password = 'password'; // SMTP password
$mail-> SMTPSecure = ''; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
$mail->addAddress(
'mymail@domain.com'); // Add a recipient
$mail->addReplyTo('<cms:show frm_email />', '<cms:show frm_name />');
$mail->WordWrap = 50; // Set word wrap to 50 characters
$mail->isHTML(true); // Set email format to HTML
$mail->From = '<cms:show frm_email />';
$mail->FromName = '<cms:show frm_name />';
$mail->Subject = 'Enquiry from your site';
$mail->Body = '<cms:show my_message />';
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent';
}
</cms:php>
</cms:if>
However 2 more issues have cropped up.
1. Attachment thing is not working (given below is the code)
<input type="file" name="my_file_ex"><br />
<cms:input
type="hidden"
name="my_file"
required='1'
validator='EmailEx::validate=max_size:512&allowed_ext:jpeg,jpg,gif,png,txt'
value='1' /> </td>
<cms:if k_error_my_file_ex>
2. Previously the mail used to come in a proper format now all the fields appear in a single line