PHP Classes

Url cut in email

Recommend this page to a friend!

      MIME E-mail message sending  >  MIME E-mail message sending package blog  >  How Can PHP Send Emai...  >  All threads  >  Url cut in email  >  (Un) Subscribe thread alerts  
Subject:Url cut in email
Summary:How to prevent it ?
Messages:3
Author:MAHE
Date:2011-03-04 10:22:31
Update:2011-03-04 20:26:21
 

  1. Url cut in email   Reply   Report abuse  
Picture of MAHE MAHE - 2011-03-04 10:22:33
Hello Sir,

I am testing your code and I have a problem with url link. When I received the mail, url link are broken. All url are cut.
e.g :

Hello Mrs. or Mr. TEST,

In order to confirm your subscription request, please click on the following link :
nameofmywebsite.com/confirmation.ph ...
d6dd58ee78cbda98

I use this code where
MSG_CONF_NEWSLETTER1 is a constant. It depends of the Language used.
$cle_abonnement is a varchar(32).


$charset='UTF-8';
// Message
$messageabonnement = $messageintro."\r\n" ;
$messageabonnement .= MSG_CONF_NEWSLETTER1 ."\r\n";
$adresse_confirmation_abonnement=$site_source_complet.'/confirmation.php?Langue='.$Langue.'&key='.$cle_abonnement ;
$messageabonnement .= $adresse_confirmation_abonnement."\r\n";
$messageabonnement .= "\r\n";
$messageabonnement .= "\n";
$messageabonnement .= '---------------------------------------'."\r\n";

....


$email_message=new email_message_class;
$email_message->default_charset=$charset;
$email_message->SetEncodedEmailHeader("To",$to_address,$to_name);
$email_message->SetEncodedEmailHeader("From",$from_address,$from_name);
$email_message->SetEncodedEmailHeader("Reply-To",$reply_address,$reply_name);
//$email_message->SetEncodedEmailHeader("Cc",'adresseemail','nom');

if(defined("PHP_OS")
&& strcmp(substr(PHP_OS,0,3),"WIN"))
$email_message->SetHeader("Return-Path",$error_delivery_address);
$email_message->SetEncodedEmailHeader("Errors-To",$error_delivery_address,$error_delivery_name);
$email_message->SetEncodedHeader("Subject",$subject);
$email_message->AddQuotedPrintableTextPart($email_message->WrapText($messageabonnement));
$error=$email_message->Send();

The result should be
In order to confirm your subscription request, please click on the following link :
nameofmywebsite.com/confirmation.ph ...

....

Thank you for your answer and sorry for my poor english.

Philippe

  2. Re: Url cut in email   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2011-03-04 18:03:37 - In reply to message 1 from MAHE
That is because WrapText is wrapping long lines. Just set the variable break_long_lines to 0, so the WrapText function does not break long lines.

  3. Re: Url cut in email   Reply   Report abuse  
Picture of MAHE MAHE - 2011-03-04 20:26:22 - In reply to message 2 from Manuel Lemos
Thank you a lot Sir.
It's working nows as I want. It's great.
Thank you again.