I have to send an email using images. I want images should be shown in email, but images are not showing, images links are showing instead of images.
Here is my code but that is not working...
Please help me.
===========================================================
My Php File Code:
<?php
// Define some constants
define( "RECIPIENT_NAME", "Web Developer" );
define( "RECIPIENT_EMAIL", "testing@testing.com" );
define( "EMAIL_SUBJECT", "Visitor Message" );
// Read the form values
$success = false;
$success_one = false;
//$senderName = isset( $_POST['senderName'] ) ? preg_replace( "/[^\.\-\' a-zA-Z0-9]/", "", $_POST['senderName'] ) : "";
$senderEmail = isset( $_POST['senderEmail'] ) ? preg_replace( "/[^\.\-\_\@a-zA-Z0-9]/", "", $_POST['senderEmail'] ) : "";
//$message = isset( $_POST['message'] ) ? preg_replace( "/(From:|To:|BCC:|CC:|Subject:|Content-Type:)/", "", $_POST['message'] ) : "";
$subject = "Coming Soon";
$message = <<<EOF
\n<img src="http://gettyanimations.com/conci_landing_page/images/logo.png" />
\nThanks you for your interest in "Conci".
\nWe will contact you soon with more details about our services.
\nSincerely, \n The Conci Team</td>
\n<img src="http://gettyanimations.com/conci_landing_page/images/logo.png" />
EOF;
// If all values exist, send the email
if ( $senderEmail ) {
$recipient = RECIPIENT_NAME . " <" . RECIPIENT_EMAIL . ">";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers = 'From: <' . $senderEmail . '>' . "\r\n";
$headers_one = "<table><tr><td><img src='http://gettyanimations.com/conci_landing_page/images/logo.png'/></td></tr></table>";
$footer_one = "<img src='http://gettyanimations.com/conci_landing_page/images/logo.png'/>";
$success = mail( $recipient, EMAIL_SUBJECT, $headers );
$success_one = mail( $senderEmail, $subject, $message );
}
// Return an appropriate response to the browser
if ( isset($_GET["ajax"]) ) {
echo $success ? "success" : "error";
} else {
?>
<html>
<head>
<title>Thanks!</title>
</head>
<body>
<?php if ( $success && $success_one ) echo "<p>“Thank you for your interest in Conci. We will contact you soon with more details about our services. Sincerely, The Conci Team”</p>" ?>
<?php if ( !$success && $success_one ) echo "<p>There was a problem sending your message. Please try again.</p>" ?>
<p>Click your browser's Back button to return to the page.</p>
</body>
</html>
<?php
}
?>
My HTML File Code:
<!doctype html>
<html lang="en">
<head>
<title>Conci</title>
<link rel="styleSheet" type="text/css" href="css/style.css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript">
var messageDelay = 2000; // How long to display status messages (in milliseconds)
// Init the form once the document is ready
$( init );
// Initialize the form
function init() {
// Hide the form initially.
// Make submitForm() the form's submit handler.
// Position the form so it sits in the centre of the browser window.
$('#contactForm').submit( submitForm ).addClass( 'positioned' );
}
// Submit the form via Ajax
function submitForm() {
var contactForm = $(this);
// Are all the fields filled in?
if ( !$('#senderEmail').val() ) {
// No; display a warning message and return to the form
$('#incompleteMessage').fadeIn().delay(messageDelay).fadeOut();
contactForm.fadeOut().delay(messageDelay).fadeIn();
} else {
// Yes; submit the form to the PHP script via Ajax
$('#sendingMessage').fadeIn();
contactForm.fadeOut();
$.ajax( {
url: contactForm.attr( 'action' ) + "?ajax=true",
type: contactForm.attr( 'method' ),
data: contactForm.serialize(),
success: submitFinished
} );
}
// Prevent the default form submission occurring
return false;
}
// Handle the Ajax response
function submitFinished( response ) {
response = $.trim( response );
$('#sendingMessage').fadeOut();
if ( response == "success" ) {
// Form submitted successfully:
// 1. Display the success message
// 2. Clear the form fields
// 3. Fade the content back in
$('#successMessage').fadeIn().delay(messageDelay).fadeOut();
$('#senderEmail').val( "" );
$('#content').delay(messageDelay+500).fadeTo( 'slow', 1 );
} else {
// Form submission failed: Display the failure message,
// then redisplay the form
$('#failureMessage').fadeIn().delay(messageDelay).fadeOut();
$('#contactForm').delay(messageDelay+500).fadeIn();
}
}
</script>
</head>
<body>
<div class="wrapper">
<header class="header"><img src="images/logo.png"/></header>
<section class="search">
<h1>Welcome to Conci Bermuda!</h1>
<h2>Something BIG is coming....</h2>
<p>Register below to receive an invitation to the Conci experience.</p>
<form id="contactForm" action="processForm.php" method="post">
<input type="email" name="senderEmail" id="senderEmail" placeholder="Your Email..." required="required" maxlength="50" />
<input type="submit" id="sendMessage" class="sendMessage" name="sendMessage" value="Send Email" />
</form>
<div id="sendingMessage" class="statusMessage"><p>Sending your message. Please wait...</p></div>
<div id="successMessage" class="statusMessage"><p>Thanks for sending your message! We'll get back to you shortly.</p></div>
<div id="failureMessage" class="statusMessage"><p>There was a problem sending your message. Please try again.</p></div>
<div id="incompleteMessage" class="statusMessage"><p>Please complete all the fields in the form before sending.</p></div>
</section>
<footer class="footer">
<ul>
<li><a href="#"><img src="images/fb-icon.png"/></a></li>
<li><a href="#"><img src="images/twitter-icon.png"/></a></li>
<li><a href="#"><img src="images/pinterest-icon.png"/></a></li>
</ul>
<div class="clear"></div>
<p>Copyright 2015 Conci Bermuda©. All rights reserved.</p>
</footer>
</div>
</body>
</html>