Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9038513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:30:22+00:00 2026-06-16T09:30:22+00:00

I am trying to send an email using php mail, however, when using an

  • 0

I am trying to send an email using php mail, however, when using an anchor tag, the link does not go past the single quote (‘) if it is present in the filename.

Here is the line of code where the trouble arises:

$message .= "<tr><td><strong>View LOA:</strong> </td><td><a     href='http://myurl.com/loa/" . $myloa . "'>" . strip_tags($myloa) . "</a></td></tr>";

($myloa is pulled from my database. I have multiple files uploaded on my server and save the file names in my DB.)

In the email, $myloa can be read as, for example, Alex’s LOA.pdf

However, if trying to click it (since it is anchored), the link only goes up to Alex. So the link looks like this: http://myurl.com/loa/Alex instead of http://myurl.com/loa/Alex‘s LOA.pdf

How can I fix this? Thanks.

Here is my full code:

$emailloa = $_POST['emailloa'];



$to .= "" . strip_tags($emailloa) . "";


$subject = "The " . strip_tags($name) . " LOA";


$message = '<html><body>';
$message .= '<table rules="all" style="border-color: #666;" cellpadding="10">';
$message .= "<tr style='background: #eee;'><td><strong>Sent by:</strong> </td><td>" .     strip_tags($_SESSION['user']['first']) . " " . strip_tags($_SESSION['user']['last']) . "    </td></tr>";
$message .= "<tr><td><strong>View LOA:</strong> </td><td><a     href='http://myurl.com/loa/" . $myloa . "'>" . strip_tags($myloa) . "</a></td></tr>";
$message .= "</table>";
$message .= "</body></html>";


$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T09:30:24+00:00Added an answer on June 16, 2026 at 9:30 am

    What if you swapped the single and double quotes?

    $message .= '<tr><td><strong>View LOA:</strong> </td><td><a     href="http://myurl.com/loa/' . $myloa . '">' . strip_tags($myloa) . '</a></td></tr>';
    

    I wonder if the double quotes are throwing off the interpreter: http://php.net/manual/en/language.types.string.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to send an email using the PHP mail function to multiple
I am trying to send email using mail() in php. I need the message
I am trying to send email using PHP mail. I get the following error:
I am trying to send email with attachment using PHP mail() function. The email
I am trying to send email using PHP. The email is an HTML email
I am trying to send email using AJAX and PHP but no success:( My
I am trying to send an HTML email using Perl. open(MAIL,|/usr/sbin/sendmail -t); ## Mail
I am trying to send an email in ASP.NET using system.net.mail the problem is
Having big problems trying to get my php script to send email. Using this
I am trying to create a PHP function to send an e-mail using SMTP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.