Jump to content

Recommended Posts

Hi,

 

I am sending a link in mail where the receipents will click to visit the site.

Unfortunately, the links are disabled. I am only getting the text "Click Here" in blue text but the link is disabled.

 

I have tested this for all mail servers link Gmail, Hotmail and Yahoomail.

 

Below is the Code for your reference.

 

$return_html.= "<a href='.$customer_url.'new_user_sign_up_verification.php?conf_code=".$confirm_code."&email=".$str_Email."&lang=".$str_lang."'>". $ADMIN_MAIL4 ."</a>";

 

Please help me to enable the link in the mail sent to the users.

 

Thank you.

Santosh

Link to comment
https://forums.phpfreaks.com/topic/122233-sending-links-in-mail/
Share on other sites

The [/url] is caused by the forum software when people don't bother to post code using the forum's code tags.

 

Does $customer_url contain http://somedomain.com/ ? so that the url is an absolute fully qualified URL? Also, is the email being sent with the proper headers and formatting so that it is a HTML email?

Hi

 

Thanks for the response.

Yes, My URL is fully qualified and tested also. Infact, I am sending the same URL below the mail to give an option to the user, in case the Link is not working, they can copy and paste the URL from the mail in the IE.

I have shown the code for your reference. The content type is : text/html.

Please help to find a solution to this problem

 

 

$headers = "From: customersupport@test.com\r\n";

$headers .= "MIME-Version: 1.0\r\n";

$boundary = uniqid("HTMLDEMO");

$headers .= "Content-Type: multipart/mixed; boundary = $boundary\r\n\r\n";

$body = "--$boundary\r\n" .

"Content-Type: text/html; charset=ISO-8859-1\r\n" .

"Content-Transfer-Encoding: base64\r\n\r\n";

$body .= "--$boundary\r\n" .

"Content-Type: text/html; charset=ISO-8859-1\r\n" .

"Content-Transfer-Encoding: base64\r\n\r\n";

$body .= chunk_split(base64_encode($return_html));

 

Thank you

Santosh

Are you using a multipart e-mail structure? This is an example (without validation) to give you a reference point:

 

<?php

$subject = 'Whatever you like';

$headers = 'From: "'.$name.'" <'.$email.'>'."\n";
$headers .= 'Reply-To: '.$your_email."\n";
$headers .= 'Delivered-To: '.$email."\n";
$headers .= 'Return-Path: '.$your_email."\n";
$headers .= 'Date: '.date('r')."\n";
$headers .= 'X-Mailer: PHP '.phpversion()."\n";
$headers .= 'X-Sender: '.$your_email."\n";
$headers .= 'X-Priority: 3'."\n";
$headers .= 'X-MSMail-Priority: Normal'."\n";
$headers .= 'MIME-Version: 1.0'."\n";

# Plain/HTML e-mail
$boundary = '==MPBoundary_'.mb_substr(sha1(time()), 0, ;

$headers .= 'Content-Type: multipart/alternative; boundary="'.$boundary.'"'."\n\n";

$content  = '--'.$boundary."\n";
$content .= 'Content-type: text/plain; charset=utf-8'."\n";
$content .= 'Content-Transfer-Encoding: 8bit'."\n\n";
$content .= $html_email;
$content .= '--'.$boundary."\n";
$content .= 'Content-type: text/html; charset=utf-8'."\n";
$content .= 'Content-Transfer-Encoding: 8bit'."\n\n";
$content .= $plain_email;
$content .= '--'.$boundary.'--'."\n";

mail($to, $subject, $content, $headers);

?>

 

Also make sure that you close your href attribute's value in double quotes (some clients don't like singles):

 

<?php
$return_html.= '<a href="'.$customer_url.'new_user_sign_up_verification.php?conf_code='.$confirm_code.'&email='.$str_Email.'&lang='.$str_lang.'">'.$ADMIN_MAIL4.'</a>';
?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.