MAIL (Message/Body) problem
Moderator: General Moderators
MAIL (Message/Body) problem
Dear All,
Am facing a small problem.Please help me.
Am doing a task in that am trying to send mails.
In that if i type any link in the textarea of message/body , after sending mail, the link is not activating.
is there any way to enable the hyperlink while using mail() function??
Waiting for your valuable replies....
Thanks and regards
MADHU
Am facing a small problem.Please help me.
Am doing a task in that am trying to send mails.
In that if i type any link in the textarea of message/body , after sending mail, the link is not activating.
is there any way to enable the hyperlink while using mail() function??
Waiting for your valuable replies....
Thanks and regards
MADHU
- aaronhall
- DevNet Resident
- Posts: 1040
- Joined: Tue Aug 13, 2002 5:10 pm
- Location: Back in Phoenix, missing the microbrews
- Contact:
Just add anchor tags around the link, e.g. <a href="http://mysite.com/asdf.php">my link</a>
Dear All,
This is the code am using to send mail.
Now the problem is when i sent a mail with HTML content like(http://mail.yahoo.com) , then after sending mail, am not able to recognise as a link.
Before using mail() function, am getting that $message (which contains the content) as link.
But when i sent a mail using mail() function , am not getting that link.
May be problem is with Content-type: text/html.
Other than this link, remaining any HTML tags am able to recognise.
Please guide me where i did mistake...
Waiting for your valuable replies....
Thanks and regards
MADHU
This is the code am using to send mail.
Now the problem is when i sent a mail with HTML content like(http://mail.yahoo.com) , then after sending mail, am not able to recognise as a link.
Before using mail() function, am getting that $message (which contains the content) as link.
But when i sent a mail using mail() function , am not getting that link.
May be problem is with Content-type: text/html.
Other than this link, remaining any HTML tags am able to recognise.
Please guide me where i did mistake...
Code: Select all
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=ISO-8859-1;\r\n";
//$headers .= "Content-type: text/plain; charset=ISO-8859-1;\r\n";
if(mail($toid, $subject, $message, $from.$headers))
{
echo "<div align=\"center\"><strong>Mail sent successfully.....</strong></div>";
}Thanks and regards
MADHU
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Code: Select all
$from.$headersCode: Select all
$from = "From: $fromid<$fromtext>\r\n";$fromtext --- mailid of the person from which mail is going to send.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Hmm...
Try
Changed:
Content-type --> Content-Type
Charset value quoted with ".."
Charset value lowercased (really shouldn't matter)
Trailing ; removed
How many mail clients have you tried this in?
Try
Code: Select all
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n";Content-type --> Content-Type
Charset value quoted with ".."
Charset value lowercased (really shouldn't matter)
Trailing ; removed
How many mail clients have you tried this in?
Hi All,
I tried like this.
In this $toid,$subject, $message and $from will come from textboxes.
Now my problem is if message contains any Links(href),then in mail that link is not coming.....
Please suggest me....
Am searching from last 3 days in Google......
Waiting for your valuable replies...
Thanks and regards
MADHU
I tried like this.
Code: Select all
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: [b]text/html[/b]; charset=iso-8859-1' . "\r\n";
if(mail($toid, $subject, $message, $from.$headers))
{
echo "<div align=\"center\"><strong>Mail sent to the users in $filename successfully.....</strong></div>";
}In this $toid,$subject, $message and $from will come from textboxes.
Now my problem is if message contains any Links(href),then in mail that link is not coming.....
Please suggest me....
Am searching from last 3 days in Google......
Waiting for your valuable replies...
Thanks and regards
MADHU
Hi all....
Please help me what is the problem....
Thanks and regards
MADHU
Code: Select all
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: [b]text/html[/b]; charset=iso-8859-1' . "\r\n";
if(mail($toid, $subject, $message, $from.$headers))
{
echo "<div align=\"center\"><strong>Mail sent to the users in $filename successfully.....</strong></div>";
echo $message; //here also am getting the content with correct format(i.e with href)
}Please help me what is the problem....
Thanks and regards
MADHU
-
satheshf12000
- Forum Commoner
- Posts: 25
- Joined: Mon Sep 04, 2006 5:38 pm
Try in this way:
Code: Select all
$eol = "\r\n";
$mailheader = 'MIME-Version: 1.0' . $eol;
$mailheader .= 'Content-type: text/html; charset=iso-8859-1' . $eol;
$mailheader .= "From: XXX Mail Services<mailer@xxxxxx.com>". $eol;
$mailheader .= 'Return-Path: Madhu <no-reply@xxxxxx.com>'.$eol; // this to set reply address.
mail($to,$subject,$msg,$mailheader);-
satheshf12000
- Forum Commoner
- Posts: 25
- Joined: Mon Sep 04, 2006 5:38 pm
$msg contains any content.
Example:
if i type http://mail.yahoo.com , then after sending mail am not able to get that as link(i.e href).
It is coming as a plain text in the mail Inbox.
Example:
if i type http://mail.yahoo.com , then after sending mail am not able to get that as link(i.e href).
It is coming as a plain text in the mail Inbox.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia