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:[email protected]?subject= 40% Funding enquiry>[email protected].</a> Also tried <a href=mailto:[email protected]?subject= 40%%20Funding%20enquiry>[email protected].</a> but both return just 40% in the subject line in the email page, anyone have any ideas/suggestions would be most appreciated Thanks =] 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:[email protected]?subject= 40% Funding enquiry">[email protected].</a> 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:[email protected]?subject= 40% Funding enquiry">[email protected].</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 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:[email protected]?subject=%2040%%20Funding%20enquiry>[email protected].</a> 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:[email protected]?subject=%2040%%20Funding%20enquiry>[email protected].</a> no :-\ still just the 40% in the subject header , Thanks though 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:[email protected]?subject=%2040%25%20Funding%20enquiry>[email protected].</a> 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? 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. Link to comment https://forums.phpfreaks.com/topic/65070-solved-mailer-help-please/#findComment-324839 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.