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

The Archive Base Latest Questions

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

Searching for the answer I found this script here However: It can send body

  • 0

Searching for the answer I found this script here

However:

It can send body of received email as plain text only. In order not to lose data (links) I need to send body in same format as it was received.

Is there a simple change for this script to achieve that?

btw, Later, I need to save linked files (from email) on my server, and replace links in the body with my own.

Thanks.

UPDATE

Somehow i solved the first issue (adding original boundery value in my email), now, i have 3 more to go. This code returns 1 with print_r($urls)

$pattern = '#^http://domain.com/(.*)(\w*)0\b#';
preg_match_all($pattern, $email, $urls);

same code returns empty array with those two outputs:

1 print_r($urls, true)

2 print_r($urls[0], true)

like this:

1

Array
(
    [0] => Array
        (
        )

    [1] => Array
        (
        )

    [2] => Array
        (
        )

)

2

Array
(
)

However, when I test code here, it works like charm

How can I get my values? It will be very nice to have them in a variables, like $url1, $url2…

Can anybody help? (Your time and effort is highly appreciated!)

  • 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-16T12:44:23+00:00Added an answer on June 16, 2026 at 12:44 pm

    I will answer on my question.

    Ok, I already solved this. Here is some info if somebody need it…

    Regex had an extra ^. Further on I improved pattern like this: "#http://domain.com/([=a-zA-Z\d/-]+)(.|\n|\r)([a-zA-Z\d/-]+)#" This urls have = and that was removed with this line: $var1=preg_replace("#=(.|\n|\r)#","",$var); This is not the best way to go, but it worked. I got my links in array, and later I was able to download files with file_get_contents() and file_put_contents() changing links was easy with str_replace. Everything is done with for loop because number of links in each email was not the same.

    Happy Holidays everybody!

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

Sidebar

Related Questions

I have this resizing script I got from an answer I found on SO.
I tried searching for this answer online but I haven't found any luck. I
While searching for an answer to this question I found this sample code which
I was searching the web for this but found no satisfying answer. I am
Searching for an answer I found this question , which is an exact opposite
searching for this question, I found this question/answer: Kohana 3 get current controller/action/arguments I
I spent some time searching for an answer to this and found plenty of
I have been searching for an answer to this dilemma but found nothing. I
I have been searching desperately for an answer to this question, but not found
Searching around I haven't found any recent answers to this question. The other answers

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.