Click here to Skip to main content
15,937,602 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
how to send email through html or php?

What I have tried:

i have tried both with php and html.
In php ,mail function couldn't access smtp port number
and in html problem with outlook that it couldn't login.....................
Updated 21-Jun-16 5:30am
Sergey Alexandrovich Kryukov 21-Jun-16 11:21am    
HTML and PHP are not alternatives. If you use PHP, you always also need HTML.
If you want to send e-mail from HTML, you can only do it using some server-side technology, PHP or not.

Your PHP problem is unclear, and your HTML problem is illusionary; you cannot do it. Maybe you just presented an anchor with e-mail URI, but it has nothing to do with your code; it's just the user sends a mail, which is not your responsibility, except providing a mail address.


1 solution

Please see my comment to the question; it does not really make sense; and your problem is unclear. After all, compare all required SMTP parameters. You can use some available e-mail program, make sure it works, and then compare with your code.

Just in case: here are the ways to send mail via PHP:
PHP: mail — Manual,
PEAR alternative: Manual :: sends a mail,
see also: Manual :: About PEAR and PEAR2.

Now, the major problem with sending mail via the Web is security. Please see this big warning in my past answer: unable to send mail, it showing the error in below code..

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900