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

  • SEARCH
  • Home
  • 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 3797036
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:20:19+00:00 2026-05-19T13:20:19+00:00

I know this is weird, but when a .com is added to the subject

  • 0

I know this is weird, but when a “.com” is added to the subject or body text to send PHP mail (like – xyz.com), the mail will not send. It’s a problem with this hosting company (ipage) but i want to see if their is something i can do in the script itself, because it’s a CMS of mines and i would like to keep generalized for everyone who uses it.

script is simple and as follows:

function confirmEmail($username, $email, $confirm_code) {

   $sitename = str_replace(".com", " .com", site_name);
   $subject  = "Your confirmation link here";
   $headers .= 'To: '.$username.' <'.$email.'>' . "\r\n";
   $headers .= "From: ".$sitename." <".support_email.">". "\r\n";
   $message  = "Your Comfirmation link \n
   Click on this link to activate your account \n
   ".root."/confirm.php?confirm=$confirm_code";

   $message = wordwrap($message, 70);

   $sendmail = mail($username,$subject,$message,$headers);
   if ( $sendmail ) {
    return true;  
   } else {
    return false;
   }

  }

Now as you can see, i replace the “.com” with ” .com”(note the space at the beginning) for the $sitename variable, and that works but the problem is the “root” contains the full path to the givin site so the link is like “xyz.com/confirm.php?confirm=$confirm_code”. I can’t allow a space before the ‘.com’ in the site path like
“xyz .com/etc…” because the obviously the user can’t click the link from within their email.

I know this is a weird problem and I have no clue on what’s going on or what to even ask the hosting to change.

*note: site_name and root are defined previously in another page, and they work fine. Also no errors are being returned.

Any ideas out there?

  • 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-05-19T13:20:20+00:00Added an answer on May 19, 2026 at 1:20 pm

    Your code is correct. Your workaround should not be necessary.

    This is very likely a provider issue.

    Don’t know about your environment, but if you have not full control of your mailserver, try sending a mail with a link using telnet so you really see everything. Often spam filters etc are badly configured and don’t return the correct codes.

    If you don’t have any luck with that I recommend switching to an external SMTP server that is well configured. You can perfectly use gmail for that if you dont send tons of mails.

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

Sidebar

Related Questions

I know this might be a no-brainer, but please read on. I also know
I know this isn't strictly a programming question but y'all must have experienced this.
I know this is a broad question, but I've inherited several poor performers and
I know this is not programming directly, but it's regarding a development workstation I'm
I know this rather goes against the idea of enums, but is it possible
I know this would be easy with position:fixed, but unfortanately I'm stuck with supporting
I know this is a long shot - but is there any way at
I know it sounds weird but I am required to put a wrapping try
I know this is probably simple and has probably been asked before, but I'm
I have this weird problem with setting up cookies with PHP. Everything worked fine

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.