0

hello,
i am trying to add a feature in my contact form that create a link with visitors submitted 'TITLE' and 'URL'.
Have a look at this code!
***In this code $attn = Visitors submitted URL and $visitor = Visitors submitted title.

$todayis = date("l, F j, Y, g:i a") ;
$attn = $attn ;
$subject = $attn;
$notes = stripcslashes($notes);
$message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor ($visitormail)\n
Browser Info: $httpagent \n
Referral : $httpref \n
[B]<a href='$attn '>$visitor </a>[/B]
";

here i have added a code like this

<a href='$attn '>$visitor </a>

but its not works!It send data in in my e-mail this way: <a href='http://www.submittedurl.com '> Submitted Title </a> but i wanna get it as a link like: Submitted Title in my email.
So what to do, any help? Thanks.

3
Contributors
10
Replies
11
Views
6 Years
Discussion Span
Last Post by rakibtg
Featured Replies
  • 1

    Your email mime type is text, you need HTML type in header. [CODE] $headers .= "Content-Type: text/html; charset=\"iso-8859-1\"\n"; [/CODE] Read More

1

Your email mime type is text, you need HTML type in header.

$headers .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
Votes + Comments
helpful
0

Actually i am new to php coding!:-/
Here is the full code.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>FeedBack</title>
</head>
<body>
<?php
require_once('recaptchalib.php');
$privatekey = "xxxxxxxxxxxxxxx";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
"(reCAPTCHA said: " . $resp->error . ")");
}
$httpagent = $_POST['httpagent'];
$visitor = $_POST['visitor'];
$visitormail = $_POST['visitormail'];
$notes = $_POST['notes'];
$attn = $_POST['attn'];
if (eregi('under construction:', $notes)) {
die ("Do NOT SUBMIT THIS TYPES OF FEEDBACK! ! ");
}
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
echo $badinput;
die ("Go back! ! ");
}
if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
die ("Use back! ! ");
}
[B]$todayis = date("l, F j, Y, g:i a") ;
$attn = $attn ;
$subject = $attn;
$notes = stripcslashes($notes);
$message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor ($visitormail)\n
Browser Info: $httpagent \n
Referral : $httpref \n
";[/B]
$from = "From: $visitormail\r\n";
mail("mail@example.com", $subject, $message, $from);
?>
<p>
<h1>Thankyou, We got your mail!</h1>
</p>
</body>
</html>

Edited by rakibtg: n/a

0

Replace the line

$from = "From: $visitormail\r\n";

with

$from = "MIME-Version: 1.0" . "\r\n";
$from .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$from .= "From: $visitormail" . "\r\n";
0

i find the problem, target="_blank" need to convert to target='_blank'
Is there any way to extract visitors submitted sites TITLE, DESCRIPTION and KEYWORDS in my mail when visitors submit their website using this mail form?
I mean when some one submit their website url(www.example.com) and mail me using this e-mail form then this mail from will extract its(www.example.com) TITLE, DESCRIPTION and KEYWORDS and then send it in my mail, is it possible to do and how to do it?
Thankyou

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.