I want to create a form in the website itself, which will directly take the users to their email account. I want that the username password window shall be in the website. Once submitted, it goes to the email inbox.

Any help pleas?? Much appreciated.

Dani AI

Generated

asked for an on-site login box that takes visitors straight into their hosted webmail; asked where the mail lives. Given the setup reported (hosted webmail on the same server, site currently static HTML and no PHP knowledge), three practical approaches exist, with pros/cons and security caveats.

First and safest: link or redirect to the host's official webmail login page. That avoids handling credentials and avoids breaking host-side protections (CSRF tokens, SameSite cookie rules).

Second: have an HTML form on the site that POSTS directly to the webmail login endpoint (only if the webmail page does not require dynamic CSRF tokens). Steps: view the webmail login page source to find the form action and input names, replicate those fields and submit with method="post" and HTTPS. Note modern webmail apps often include hidden tokens or SameSite cookie settings that make a simple static form fail.

Third (integrated but advanced): implement a server-side proxy/SSO on the same host (PHP on the site) that submits credentials to webmail, captures the session, and redirects the user. This requires secure code (no logging of credentials, strict HTTPS, no persistent storage of passwords) and likely host cooperation.

Small HTML example (placeholder only):

<form action="" method="post" target="_blank">
<input name="username">
<input type="password" name="password">
<input type="submit" value="Login">
</form>

Troubleshooting notes: check for hidden CSRF fields, inspect network requests in the browser dev tools, confirm cookies are set for the mail domain, and confirm the host permits auto-posting. Security note: never capture or store plain passwords on the site, and consult the hosting provider if integration requires server-side work.

Recommended Answers

All 3 Replies

You didn't tell us where is the email account?

Which software is used for the email client?

You didn't tell us where is the email account?

Which software is used for the email client?

The mail is provided by the hosting company.
Its in the same server.

something like
URL:
mail:

btw server is Linux based, and the mail is PHP based, my website is html based, cuz I dont know nothing about PHP.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.