Mr P!nk Posted August 15, 2007 Share Posted August 15, 2007 Hi I've created a php mail system which distributes email newsletters to 100's of our clients, within the newsletter there's a mailto link which works fine but the subject i'm trying to force isn't coming up properly, it's just the first word of the sentence that shows. this is the code im using <a href=mailto:info@email.co.uk?subject= 40% Funding enquiry>info@email.co.uk.</a> Also tried <a href=mailto:info@email.co.uk?subject= 40%%20Funding%20enquiry>info@email.co.uk.</a> but both return just 40% in the subject line in the email page, anyone have any ideas/suggestions would be most appreciated Thanks =] Quote Link to comment https://forums.phpfreaks.com/topic/65070-solved-mailer-help-please/ Share on other sites More sharing options...
The Little Guy Posted August 15, 2007 Share Posted August 15, 2007 try placing double quotes around it like so: <a href="mailto:info@email.co.uk?subject= 40% Funding enquiry">info@email.co.uk.</a> Quote Link to comment https://forums.phpfreaks.com/topic/65070-solved-mailer-help-please/#findComment-324759 Share on other sites More sharing options...
Mr P!nk Posted August 15, 2007 Author Share Posted August 15, 2007 try placing double quotes around it like so: <a href="mailto:info@email.co.uk?subject= 40% Funding enquiry">info@email.co.uk.</a> thanks for the quick reply. that's not possible to do with this mailer, there's a link parse file running along side so you don't have to enter the full HTML markup (i can post the code for this for a better understanding) so if i put the quotes in it stops the mailto from working :-\. but thanks for your input appreciated Quote Link to comment https://forums.phpfreaks.com/topic/65070-solved-mailer-help-please/#findComment-324765 Share on other sites More sharing options...
The Little Guy Posted August 15, 2007 Share Posted August 15, 2007 This??? <a href=mailto:info@email.co.uk?subject=%2040%%20Funding%20enquiry>info@email.co.uk.</a> Quote Link to comment https://forums.phpfreaks.com/topic/65070-solved-mailer-help-please/#findComment-324778 Share on other sites More sharing options...
Mr P!nk Posted August 15, 2007 Author Share Posted August 15, 2007 This is the link parse that stops me from doing simple HTML tags <?php // // Parse text for links // // KNOWN BUGS // the characters "/>" are added when a link is parsed after a line break // function parse($sample){ // constructors & declarations $Ngram = array(); $text = nl2br($sample); // split text in Ngrams $Ngram = explode(" ", $text); //$Ngram = preg_split( "/[ \n]+/", $text ); // perform search for($i=0; $i<count($Ngram); $i++){ //echo $Ngram[$i]."<br />"; // check to see if Ngram is minimum web address length ie. www.xx.de if(strlen($Ngram[$i]) >= 9){ // look for www. if(substr($Ngram[$i],0,4) == "www."){ // clean up fullstops if(substr($Ngram[$i],-1,1) == "."){ $length = strlen($Ngram[$i])- 1; $Ngram[$i] = substr($Ngram[$i],0,$length); } // strip html tags $Ngram[$i] = strip_tags($Ngram[$i]); // convert to hyperlink $tmp = "<a href=\"http://" . $Ngram[$i] . "\" target=\"_BLANK\">" . $Ngram[$i] . "</a>"; $Ngram[$i] = $tmp; } // end IF } // end IF } // end FOR // re-assemble the text for($i=0; $i<count($Ngram); $i++){ $parsed .= $Ngram[$i] . " "; } // end FOR // return parsed text return $parsed; } ?> This??? <a href=mailto:info@email.co.uk?subject=%2040%%20Funding%20enquiry>info@email.co.uk.</a> no :-\ still just the 40% in the subject header , Thanks though Quote Link to comment https://forums.phpfreaks.com/topic/65070-solved-mailer-help-please/#findComment-324796 Share on other sites More sharing options...
The Little Guy Posted August 15, 2007 Share Posted August 15, 2007 Try this: % -> %25 for url encoding <a href=mailto:info@email.co.uk?subject=%2040%25%20Funding%20enquiry>info@email.co.uk.</a> Quote Link to comment https://forums.phpfreaks.com/topic/65070-solved-mailer-help-please/#findComment-324815 Share on other sites More sharing options...
Mr P!nk Posted August 15, 2007 Author Share Posted August 15, 2007 thank you very much. it worked can you tell me what that's just done? Quote Link to comment https://forums.phpfreaks.com/topic/65070-solved-mailer-help-please/#findComment-324824 Share on other sites More sharing options...
The Little Guy Posted August 15, 2007 Share Posted August 15, 2007 I replaced the % sign with a %25 (a URL ecoded version of %) it must have been reading it and when it got to the % after the 40, it didn't know what to do. Quote Link to comment https://forums.phpfreaks.com/topic/65070-solved-mailer-help-please/#findComment-324839 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.