Forum Moderators: coopster

Message Too Old, No Replies

Sending mail

While Click submit button mail have to send to the address

         

Madhu

12:07 pm on Jul 27, 2007 (gmt 0)

10+ Year Member



i am new to php
i haven given an assignment to create a contact form page
I have designed that page
but the main function is that while clicking the submit button an mail have to sent to the given particular mail address. What i have to do for that .
Plz help

Madhu

RonPK

12:27 pm on Jul 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello Madhu, have you looked at the manual? [php.net...]

The basic syntax of the

mail()
function is easy:

mail($to, $subject, $message, 'From: me@example.com');

dreamcatcher

12:27 pm on Jul 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Madhu,

Try this thread in our library:
[webmasterworld.com...]

dc

vincevincevince

4:30 pm on Jul 27, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Madhu,

One additional thing to be aware of is that recently bots have been taking over contact forms. For that reason, santise (check/clean) your data very well, especially sender addresses.

Madhu

5:27 am on Jul 30, 2007 (gmt 0)

10+ Year Member



but my friends....
It is not working still..

it is showing some SMTP error

eelixduppy

6:13 am on Jul 30, 2007 (gmt 0)



Have you properly setup your SMTP server to send mail? Also, if you need to alter the default values in php.ini for your setup, you might want to take a look at those directives:
[php.net...]
[php.net...]

Madhu

6:19 am on Jul 30, 2007 (gmt 0)

10+ Year Member



With the help of [webmasterworld.com...] i tried to send email but it is showing the following error .What i have to do?

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\Program Files\xampp\htdocs\mailer\sendemail.php on line 35

RonPK

7:08 am on Jul 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



SMTP is the protocol that does the actual sending. PHP cannot send mail by itself; it needs an SMTP server for that.

It's quite normal that there is no SMTP server on a Windows machine. You may need to specify your provider's information in php.ini. So, please re-read eelixduppy's post...

[edited by: RonPK at 7:09 am (utc) on July 30, 2007]