Click here to Skip to main content
15,917,473 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
in my page first i have html body
and i have
smtp server :<input type='text' name="srv" value="smtp.gmail.com" />



...
so i wanna in there in my php code take that text how??
i do this $mail->Host = $_GET['srv'];
but i see this erroe
SMTP -> ERROR: Failed to connect to server: No connection could be made because the target machine actively refused it. (10061)
help please
Posted
Comments
Sergey Alexandrovich Kryukov 30-Jul-12 1:54am    
How do you think it supposed to work?
--SA

1 solution

This is not how it's done. In the simplest case, you can have an HTML form with the attribute method="post" and post some data to your server. Your PHP script should process this data, create a e-mail package and send it from the server side to the SMTP server:
http://php.net/manual/en/function.mail.php[^].

Now, a big warning for you: if you do it directly without proper validation, your host can be turned into a zombie sending spam, or something like that, in no time.

Please see my past answer for further detail:
unable to send mail , it showing the error in below code .[^].

Be safe.

—SA
 
Share this answer
 
Comments
rpm3d 30-Jul-12 2:07am    
thank you
so if i have some questions can i ask you??if yes send for me your email or something
Sergey Alexandrovich Kryukov 30-Jul-12 2:30am    
You can address me through my Web site found in my profile; it has a "contact me" page, but I cannot promise anything. By the way, please be advised that publishing e-mail addresses on the Web means opening a door to spamming.

Also, I would advice you to ask me questions through this site, if you can, of course. If you send me notification on your question, I'll always read it and pay attention for your question. But if there is something you need to ask in private, I'll consider answering (again, no promises -- please understand that).
--SA
rpm3d 30-Jul-12 2:38am    
THANK you
i understand there is no promises!!!!
but still you read my questions this is hope :)
Sergey Alexandrovich Kryukov 30-Jul-12 2:43am    
I'll try to help if this is feasible enough...
--SA

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