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 526277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:45:33+00:00 2026-05-13T08:45:33+00:00

okay, here is the code while (!feof($text)) { $name = fgets($text); $number = fgets($text);

  • 0

okay, here is the code

while (!feof($text)) {
    $name = fgets($text);
    $number = fgets($text);
    $carrier = fgets($text);
    $date = fgets($text);
    $line = fgets($text);


    $content = $_POST['message']; 

    $message .= $content; 
    $message .= "\n";
    $number = $number;


    mail("$number@vtext.com", "Event Alert", $message, "SGA"); 
    Header("Location: mailconf.php");
}

I am trying to get a message sent to a phone, I have ‘message’ coming in from a text area, and then I assign it to “$content” then I put “$content” into “$message” and then as you can see, in my mail line, I want the address to be the variable “number”@vtext.com I have the while loop because there are many people in these files I wish to send a message to…
When I change the “$number@vtext.com” to my email address, it sends everything fine, I just cannot seem to get it to send to a phone number, please help!
thanks!

  • 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-13T08:45:33+00:00Added an answer on May 13, 2026 at 8:45 am

    The problem is that fgets includes the newline character as part of the return. So you are effectively sending an email to:

    1234567890
    @vtext.com

    Which of course is invalid. Change your line that reads $number = $number to:

    $number = trim($number);
    

    And the rest of your code should function as expected, with the email being received on your phone.

    Part of my original answer

    I would highly recommend using a (probably paid) service to send SMS messages to phones if you need anything remotely reliable. A quick search yielded a few results:

    1. PHP/SMS Tutorial
    2. A list of 5 ways to Text for free <– This link is dated, but might still be helpful
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay. Here's the code. XML Parsing Error: not well-formed <item_to_page_title><![CDATA[Breaking news, real-time scores and
Okay, so here is my code: public static void playAgain(Scanner in){ System.out.print(Play again?: );
Okay, so here is what I'm trying to do. The user inputs a number.
Okay here's my situation. I have the following branches development development-kirby (270 commits ahead
Okay here is what I'm trying to do: I have a model object that
Okay so here's, the scenario I have a thumbnail that contains an artists profile
Okay so here is what I want to do. I want to add a
Okay so here's what I'm doing. I'm making a request to a server to
Okay so here is the deal. As the question states, I'm trying to POST
Okay basically here's where I'm at. I have a list of PropertyDescriptor objects. These

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.