david.tigner 62 Newbie Poster

I am not pretending to send emails from x@gmail.com or any other email address. Here's what is happening: If a submitter (the one that fills out the form and presses the Submit button) doesn't enter an email address ending in a domain that I own, the submitted info will not send. If they do, it will. The email address they enter in this case does not have to be real, only end in a domain that I own. Furthermore, in order for a submitter to get a real email address ending in a domain that I own, they would have to contact me to do so. For 11 years, up until Feb 2024, the submitter could enter any email address (or anything really, I've received submissions where for email address, the submitter put their actual address (for example, 123 Main Street)). Considering this, what needs to be done is have the email address the submission form was sent from be something like submissions@RTO-USA.net (or other domain that I own) but then have the submitter's email address appear in the body of the email so I would know who to reply to. I believe this is what Dani is referring to: 'In your mail headers, you can specify both a From: email address, that is an email address from your domain name, as well as a separate Reply-To: email address, that can be any email.'. This is what my next round of edits/testing was going to be.

Biiim 182 Junior Poster

Hey David,

You should not pretend to send an email from x@gmail.com as this is spoofing.

I forward all forms from a website from a generic email such as forms@ or enquiry@ (@yourlocaldomain.com)

Emails have basic checks done on them, which is why your spoofing fails, you are trying to say X@gmail.com sent an email but gmail didn't, only gmail.com has the authority to say who can send emails for gmail.com, which is why you need to send the email from a domain that you own.

If you say what problem you are trying to solve there is probably a solution for it, like you can add a "replyto:" header to be able to reply back to the custom email address?

It is all done in DNS, to send an email the domain is looked up to find the mail exchange record(mx):

Mail Server
mx:rto-usa.net - 1 Tests Failed
Pref    Hostname    IP Address  TTL
10  mx00.ionos.com  74.208.5.3  60 min
10  mx01.ionos.com  74.208.5.21 60 min

and to receive an email the spf(sender policy framework) record:

spf:rto-usa.net
Type    Domain Name TTL Record  Prefix  Value   PrefixDesc  Description
record                  txt     v=spf1 include:_spf-us.ionos.com ~all
v                   spf1        The SPF record version
include             +   _spf-us.ionos.com   Pass    The specified domain is searched for an 'allow'.
all             ~       SoftFail    Always matches. It goes at the end of your record.

https://mxtoolbox.com/emailhealth/rto-usa.net/

Then it checks that your IP address is in the list of allowed IP Addresses to send for that domain, if not you are spoofing and any email …

david.tigner 62 Newbie Poster

The way I see it is that the email address in question is one inputted by the submitter. What if this question is not asked ? So I'm seeing if in the back end PHP file, the email address in question is not anything entered by submitter but simply one with the correct @site.com ending. That way should slip "under the radar" and submitted info would send. It also seems to me the submitter's email address question doesn't have to be removed. That submitted info would still display in the submitted info email's body but would be from "<anything>@site.com". And since its the @site.com part of the email address that allows the submitted info to send (whatever is to the left of the @ is irrelevant), the sender would be the site itself and not the submitter. But the submitter's email address would still display in the body. That way should be able to "have cake and eat it". I'll be running new testing to see what happens...

Dani 4,084 The Queen of DaniWeb Administrator Featured Poster Premium Member

If this does in fact solve the problem, it would make replying back to the submitter a little bit more complicated

In your mail headers, you can specify both a From: email address, that is an email address from your domain name, as well as a separate Reply-To: email address, that can be any email. This way, when someone clicks on the Reply button from their email client, it will reply to the email address specified in Reply-To.

david.tigner 62 Newbie Poster

I'll do whatever works to get the submission pages to send again with any submitter's email address. The End Justifies The Means. If it works then I can refine it as needed.

rproffitt commented: This isn't a code issue. It's the email server rules. Talk to your provider. +0
david.tigner 62 Newbie Poster

Then it seems to me that if I change $from = $_POST['ShowingEmail']; to $from = "Unknown@RTO-USA.com"; (or @SubterraneanSoundStudio.com, etc.) then the submitted info should send. This Unknown@RTO-USA.com email address is fake but apparently that doesn't matter. The only thing that matters is that the @domain.com part of the email address matches 1 of the domains provided by IONOS (my URL supplier). If this does in fact solve the problem, it would make replying back to the submitter a little bit more complicated as instead of replying to the email, would have to forward it to the submitter's email address, e.g. $_POST['ShowingEmail']. I'll be trying that to see if the online submission pages send without the submitter having to enter an email address ending in @RTO-USA.net, etc. In these examples, the submitter would be John Smith, me or whoever and the sender would be the website itself. Without getting the submitter's email address, the forms would be kind of useless as I wouldn't be able to email the submitter (only call them if phone number is one of the questions on the on-line submission form (most of them ask this question)).

$from = $_POST['ShowingEmail'];
$headers = "From: $from" . "\r\n";
rproffitt commented: Weird formatting choice. +0
david.tigner 62 Newbie Poster

If John isn't the sender then who is ? Also, continuing from the John Smith example, if John Smith enters his email address as johnsmith@SubterraneanSoundStudio.com or johnsmith@RTO-USA.net (ficticious email addresses) then the submitted info would be emailed to me but if he uses his true email address then it would not.

Continuing from this example, lets say, I, David Tigner, submit one of my online submission forms using my real email address of truth625@yahoo.com. The submitted info would not be sent. Would that mean that I am not the sender ? However, if I used the fake email address of truth625@RTO-USA.net, it would get sent. I enter true information and it doesn't get sent but enter false information and it does. That's anti-spoof measures ?

rproffitt commented: I think you're almost there. What sends the email is your code and as such is the sender so any other domain would be a spoof. +0
david.tigner 62 Newbie Poster

There is no making emails "appear" to be from other than the true sender. I'll explain further. Suppose John Smith has an email address of johnsmith@gmail.com. John then goes on to one of my sites, lets say RTO-USA.net, and fills out an online submission form and enters his email address truthfully (johnsmith@gmail.com). This email address is his real email address and he is telling the truth. He presses the submit button. The submitted info would fail to send because his email address wasn't entered as johnsmith@RTO-USA.net (or johnsmith@SubterraneanSoundStudio.com, etc.). Who would be the true sender, John Smith of email address johnsmith@gmail.com or someone else ?

rproffitt commented: Since John isn't the sender but your code then all is as it should be today. Anti-spoof measures are working. +0
david.tigner 62 Newbie Poster

That's a problem. The email addresses issued for @RadiantNewHorizonHomes.com or 1 of the other 4 are created by me. Unknown parties that submit online forms on one of my domains would not have one of these email addresses. I would want to receive the submitted info from senders of any email address like has been since 2011 until Feb 2024. This is crucial so I could reply back to them. There are many online submission pages running on many sites which do not require the sender to have the same email address ending as the domain. From what you're saying if someone has an email address ending in @gmail.com then the only website that an online submission page would send submitted info from would be gmail.com. Continuing from that example, lets say someone is visiting my site RTO-USA.com and wants to submit an online submission form. In order for me to receive that submission, the user would have to contact me first to get an email address ending in @RTO-USA.net (or 1 of the other 4). Then they would have to put the email address that I created for them on the online submission form in order for me to receive it. To me, this scenario seems ridiculous and obviously there is a way for online submission pages to send submitted info without the user having to have an email address ending in the domain that the online submission page is on. For 13 years mine did after all...

rproffitt commented: Time to talk to your email provider. This is anti-spoofing not anti-spam. i.e. making emails "appear" to be from other than the true sender. +0
david.tigner 62 Newbie Poster

My 4 domains are all through URL provider IONOS. The question is why does the sender's email address as entered on the front end of the on-line submission form have to have the same ending as the domain name of the site or one of the other 3 or else submitted info fails to send ?

rproffitt commented: Exactly what a good email server should do. Sender should match with domain being sent from. +0
aundigital 0 Newbie Poster

It looks like you're experiencing some trouble with your navigation menu. Based on the code you've provided, here are a few things to check:

CSS Styling: Ensure that your styles.css file is correctly linked and that there are no errors in the styling code that could be affecting the alignment and appearance of the navigation links.
List Item Display: By default, list items (<li>) in an unordered list (<ul>) are displayed as block elements, which could affect their alignment. You might want to set them to display as inline or inline-block elements to ensure they align horizontally.
Resetting Default Styles: Sometimes, default browser styles can interfere with custom styling. Consider using a CSS reset or explicitly setting styles like padding, margin, and list-style-type to ensure consistent rendering across different browsers.
Here's a quick example of how you could adjust your CSS to align the navigation links horizontally:

nav ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

nav li {
  display: inline;
  margin-right: 20px; /* Adjust spacing between links as needed */
}

nav li:last-child {
  margin-right: 0; /* Remove margin from the last list item to prevent extra spacing */
}
Steve_89 0 Newbie Poster

It seems like the issue might be with the path to the image. Here are a few things to check:

  1. Relative Path: Ensure that the path to your image is relative to the location of your HTML file. If your HTML file and the "images" folder are in the same directory, your current path should work.
  2. File Extension: Make sure the file extension of your image is correct. If your image is a JPEG, the extension should be ".jpg" or ".jpeg".
  3. Case Sensitivity: Check that the file path and name are spelled correctly and that the case matches exactly.
  4. Folder Structure: Double-check that your image is indeed in the "images" folder and that the folder itself is located in the correct directory relative to your HTML file.
  5. File Permissions: Ensure that the image file has appropriate permissions set to be accessed by your HTML file.

If after checking these things your image still isn't displaying, you might want to inspect the page using your browser's developer tools (usually accessed by pressing F12) to see if there are any error messages related to loading the image. This can provide further clues as to what might be going wrong.

david.tigner 62 Newbie Poster

I just discovered some new information on why the online submission pages weren't sending as during some testing I discovered there was a way for the submitted info to be sent. Here it is. I have online submission pages on 4 websites: RadiantNewHorizonHomes.com, RTO-USA.net, SubterraneanSoundStudio.com and RebHellionRecords.com. Each of these 4 domains can have email addresses associated with them (e.g. name@RadiantNewHorizonHomes.com, name@RTO-USA.net, etc.). If, on the front end of the submission form, in the input box for sender's email address, ANY email address (real or fake) can be entered and the submitted information will send successfully. But here's the catch. While on the left side of the email address, anything can be sent (real or fake), the right side of the email address (e.g. the @url.com part) MUST be @RadiantNewHorizonHomes.com, @RTO-USA.net, @SubterraneanSoundStudio.com or @RebHellionRecords.com otherwise the submitted info will not send. These 4 right side endings can be used interchangeably on any of the 4 sites (for example could put name@RTO-USA.net on RadiantNewHorizonHomes.com and submitted info would send). Any other email address right side (for example @gmail.com, @aol.com, etc. or even a fake, perhaps @domain.fake) would fail to send. In the past, any email address (real or fake) could be submitted and would send successfully.
Any insights on how to cure this issue ?

rproffitt commented: That sounds like your host has implemented anti-spam methods. The domain you mention appears to be yours so why should it be other than radiant? +17
Biiim 182 Junior Poster

I checked my code and I only found 2 differences, the first is the 2 use commands before the require:

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

require 'includes/PHPMailer/src/Exception.php';
require 'includes/PHPMailer/src/PHPMailer.php';
require 'includes/PHPMailer/src/SMTP.php';

and the second is mine uses port 587 instead of 465:

$mail->Port       = 587;      //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`

Otherwise the code you pasted is the same as mine, I also have date_default_timezone_set('Etc/UTC'); but I can't think of why that would prevent an error

EDIT:
Also I noticed your email account you are logging into is @aol.com you probably can't log in as an AOL account, as that domain is owned by Yahoo.

You need an email address that has a mailbox setup on your email server at smtp.ionos.com (74.208.5.2):

Type    Domain Name     IP Address      TTL
A       smtp.ionos.com  74.208.5.2  24 hrs

You could possibly spoof setting up an aol.com account on your email server but it won't work practically as aol.com is owned by Yahoo so you cannot tell the DNS servers to redirect that domain to resolve to your email server's IP address and you will probably get into a lot of other problems with other authentication checks that require DNS access.

EDIT2:

You could also try taking the PHP out of the try - catch block to see if that helps, I have had odd hidden behaviour in try catch blocks in different languages before, something like:

$mail = new PHPMailer(TRUE);
$mail->CharSet = "UTF-8";
$mail->Encoding = 'base64';
$mail->isSMTP(); …
Chris_103 -10 Newbie Poster

It seems like you're experiencing issues with PHP-based email functionality, where submissions are not triggering emails to be sent. Let's dive into the code snippet you provided and see if we can identify any potential issues or improvements.

Dani commented: And ... ? -8
david.tigner 62 Newbie Poster

This one is becoming more perplexing. After adding in the PHPMailer coding, page would crash (e.g. blank white screen, HTML file that would display the screen doesn't even start at all, e.g. error in the 1st running PHP file). Adding the semi-colon at end of line 18 (in previously discussed code) did not work and funny thing is, the original coding did not have the ; there and while no emails of submitted info were being sent at least the screen display HTML file (2nd running file after the PHP) was. So I started adding the new code bit by bit to the original PHP file to see where it would crash. First I added:
require 'PHPMailer/PHPMailer/src/Exception.php'; require 'PHPMailer/PHPMailer/src/PHPMailer.php'; require 'PHPMailer/PHPMailer/src/SMTP.php';
The program did not crash.
Then I added:

$mail = new PHPMailer(TRUE);
/* Open the try/catch block. */
try {
    /* Set the mail sender. */

  $mail->CharSet = "UTF-8";
  $mail->Encoding = 'base64';
  $mail->isSMTP();
  $mail->Host       = 'smtp.ionos.com';                     //Set the SMTP server to send through
  $mail->SMTPAuth   = true;
  $mail->SMTPSecure = 'tls';
  $mail->Username   = 'kaosfrenzy@aol.com';                     //SMTP username
  $mail->Password   = '(password)';                               //SMTP password
  $mail->Port       = 465;                                    //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`

    // $mail->DKIM_domain = 'example.com';
    // $mail->DKIM_private = 'test.key';
    // $mail->DKIM_selector = '_default';
    // $mail->DKIM_passphrase = '';
    // $mail->DKIM_identity = $mail->From;
    // //Suppress listing signed header fields in signature, defaults to true for debugging purpose
    // $mail->DKIM_copyHeaderFields = false;
    //Optionally you can add extra headers for signing to meet special requirements
    //$mail->DKIM_extraHeaders = ['List-Unsubscribe', …
khan zain -4 Newbie Poster

"I'm attempting to embed an image in my HTML page, but it's not showing up. I've checked the file path, and it seems correct. Below is the code I'm using. Any insights on why the image isn't displaying as expected?""

<!DOCTYPE html>
<html lang=""en"">
<head>
    <meta charset=""UTF-8"">
    <meta name=""viewport"" content=""width=device-width, initial-scale=1.0"">
    <title>Image Woes</title>
</head>
<body>



<h1>My Webpage</h1>

<img src=""images/my-image.jpg"" alt=""My Image"">



</body>
</html>"
Salem commented: spam -4
khan zain -4 Newbie Poster

"I'm working on a navigation menu for my HTML page, but it's not behaving as expected. The links aren't aligning properly, and the styling seems a bit wonky. I've included the code below. Can anyone help me figure out what's causing this navigation headache?

This my Code

<!DOCTYPE html>




<html lang=""en"">




<head>


<meta charset=""UTF-8"">
<meta name=""viewport"" content=""width=device-width, initial-scale=1.0"">
<title>Navigation Woes</title>
<link rel=""stylesheet"" href=""styles.css"">


</head>




<body>



<nav>
    <ul>
        <li><a href=""#"">Home</a></li>
        <li><a href=""#"">About</a></li>
        <li><a href=""#"">Services</a></li>
        <li><a href=""#"">Contact</a></li>
    </ul>
</nav>



</body>




</html>

The aim is to have a simple navigation menu, but it's not looking quite right. The links aren't aligning properly, and the styling feels off."

Dani 4,084 The Queen of DaniWeb Administrator Featured Poster Premium Member

You can use a website like Built With if you want to quickly see what frameworks a website that is already in their system is using.

However, to figure it out for yourself, it's just a matter of looking at the HTML source code for a webpage and seeing if you can find javascript tags, etc. that are used by the framework. For example, you can see that we use jQuery and Bootstrap here at DaniWeb.

That being said, this is only going to tell you what's being used on the front end. It takes some hacker-level sleuthing to figure out what backend technologies a website is using, if they aren't announcing them.

Chris_103 -10 Newbie Poster

To retrieve all records associated with the current user, you can use the fetchAll() method instead of fetch(). Here's how you can modify your code:

// Query database to retrieve records associated with the user
$sql = "SELECT * FROM table_name WHERE variable_name = :variable_name";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':variable_name', $variable_name, PDO::PARAM_STR);
$stmt->execute();
$records = $stmt->fetchAll(PDO::FETCH_ASSOC);

This will fetch all rows that match the criteria specified in the SQL query and store them in the $records variable as an array of associative arrays.

Biiim commented: looks like an AI answer, he did use the fetchAll command but got 1 result -2
rproffitt 2,580 "Nothing to see here." Moderator
rproffitt 2,580 "Nothing to see here." Moderator
  1. Read the source Luke.
  2. Wappalyzer Chrome extension
ndonetimok 0 Newbie Poster

Hello guys, please can someone explain to me how i can know the framework of any website on the internet. I know how i can detect wordpress but other framework are hard for me. Please i need assistance on this.

Rabiya_1 0 Newbie Poster

I'm New In c# and want to create a windows service
here what I'm trying

public TestService()  
        {  
            InitializeComponent();  
            timeDelay = new System.Timers.Timer();  
            timeDelay.Elapsed += new System.Timers.ElapsedEventHandler(WorkProcess);  
        }  
        public void WorkProcess(object sender, System.Timers.ElapsedEventArgs e)  
        {  
            string process = "Timer Tick " + count;  
            LogService(process);  
            count++;  
        }  
        protected override void OnStart(string[] args)  
        {  
            LogService("Service is Started");  
            timeDelay.Enabled = true;  
        }  
        protected override void OnStop()  
        {  
            LogService("Service Stoped");  
            timeDelay.Enabled = false;  
        }  
        private void LogService(string content)  
        {  
            FileStream fs = new FileStream(@ "d:\TestServiceLog.txt", FileMode.OpenOrCreate, FileAccess.Write);  
            StreamWriter sw = new StreamWriter(fs);  
            sw.BaseStream.Seek(0, SeekOrigin.End);  
            sw.WriteLine(content);  
            sw.Flush();  
            sw.Close();  
        }  




    Can any body help me step by step guide
Biiim 182 Junior Poster

logically, it would be because WHERE variable_name = :variable_name matches 1 row in your table

maybe try a var_dump(str_replace(':variable_name',"'some_value'",$sql));var_dump($records);?

run the sql on whichever way you use to access your DB directly

I don't use PDO so i'm not too familiar on how it returns results, either way you will know which part is faulty after you do the above.

Biiim 182 Junior Poster

Hi David,

More problems. I incorporated the coding Biiim provided. Before any changes, after submission, would display the correct (yellow) screen. After code changed, not only will still not send email but screen turns blank white. URL provider, IONOS, told me that the Host is smtp.ionos.com and the Username and password are for an email address associated with the domain that the online submission page is on, and since these online submission pages are on a total of 4 domains, each using a different email address, if doing one on a different domain, would have a different username and password (doesn't explain how to send more than 1 email address though, including forward only email addresses that don't have password). They also said that Port = 465. In the code block below, I included the new code added (plus the original all //'d). The submission pages use ReCaptcha 3 which works so I omitted the code for it from the code block below. One weird thing, in my editor, the 'use' commands were coming back as syntax errors but would display blank white screen regardless if the use commands are there or //'d. The 'includes' directory name from Biiim's code was changed to PHPMailer and is in the web root directory (each of the 4 domains has its own web root directory, the PHPMailer one is in the root as are the other 4, such as RNHindex, directory for RadiantNewHorizonHomes.com where the code block shown below is stored: e.g. …

Dani 4,084 The Queen of DaniWeb Administrator Featured Poster Premium Member

To clarify, I am suggesting:

[...]

//make your email body to send here
$survey =
    "RadiantNewHorizonHomes.com General Inquiries" . "\r\n" . "\r\n" .
    "Name: " . $_POST['Name'] . "\r\n" .
    "E-mail Address: " . $_POST['Email'] . "\r\n" .
    "Phone Number: " . $_POST['Phone'] . "\r\n" .
    "Comments or Questions: " . $_POST['Message'] . "\r\n"
;

[...]
Dani 4,084 The Queen of DaniWeb Administrator Featured Poster Premium Member

After code changed, not only will still not send email but screen turns blank white.

That's a PHP fatal error. It could be a syntax error, or it could also be that PHPMailer is not in the location you're telling PHP to look. Do you have any way of accessing the error log? Without access to the server, perhaps through a web-based control panel like cPanel, etc.?

At first glance, I see that on lines 11-18 in the code you posted above, you don't have a semi-colon at the end.

Mikekelvin 0 Newbie Poster

To ensure that you're retrieving all records associated with the current user, you need to make sure that your query accurately filters the data based on the user's identifier (variable_name). Here's how you can modify your query to achieve this:

// Assuming $currentUser holds the identifier of the current user

// Query database to retrieve records associated with the current user
$sql = "SELECT * FROM table_name WHERE variable_name = :variable_name";
$stmt = $conn->prepare($sql);
$stmt->bindParam(':variable_name', $currentUser, PDO::PARAM_STR);
$stmt->execute();
$records = $stmt->fetchAll(PDO::FETCH_ASSOC);

In this modified version of your code, $currentUser represents the identifier of the current user. This identifier should uniquely identify the current user in your database. By binding this value to the :variable_name parameter in your SQL query, you ensure that only records associated with the current user are retrieved.

Make sure that $currentUser holds the correct value before executing the query to ensure accurate filtering of records. If there are still issues with retrieving multiple rows of data, verify that there are indeed multiple records associated with the current user in your database.

david.tigner 62 Newbie Poster

More problems. I incorporated the coding Biiim provided. Before any changes, after submission, would display the correct (yellow) screen. After code changed, not only will still not send email but screen turns blank white. URL provider, IONOS, told me that the Host is smtp.ionos.com and the Username and password are for an email address associated with the domain that the online submission page is on, and since these online submission pages are on a total of 4 domains, each using a different email address, if doing one on a different domain, would have a different username and password (doesn't explain how to send more than 1 email address though, including forward only email addresses that don't have password). They also said that Port = 465. In the code block below, I included the new code added (plus the original all //'d). The submission pages use ReCaptcha 3 which works so I omitted the code for it from the code block below. One weird thing, in my editor, the 'use' commands were coming back as syntax errors but would display blank white screen regardless if the use commands are there or //'d. The 'includes' directory name from Biiim's code was changed to PHPMailer and is in the web root directory (each of the 4 domains has its own web root directory, the PHPMailer one is in the root as are the other 4, such as RNHindex, directory for RadiantNewHorizonHomes.com where the code block shown below is stored: e.g. in the root …