Help Please with contact form to send email

the mail() function

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Mon Oct 10, 2011 9:17 am

Help Please with contact form to send email

Postby beenice » Mon Oct 10, 2011 9:42 am

Hello people
I am brand new to php and......
Having made a captcha that worked I tried to send an email to an email address and these errors came up - could anyone please let me know what the problem may be please, I would appreciate it very much:-

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 C:\wamp\www\php_myproject\html-contact-form.php on line 52

Warning: Cannot modify header information - headers already sent by (output started at C:\wamp\www\php_myproject\html-contact-form.php:52) in C:\wamp\www\php_myproject\html-contact-form.php on line 54

Here is the coded section from line 34

34 if(empty($errors))
36 //send the email
37 $to = $your_email;
38 $subject="New form submission";
39 $from = $your_email;
40 $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
42 $body = "A user $name submitted the contact form:\n".
43 "Name: $name\n".
44 "Email: $visitor_email \n".
45 "Message: \n ".
46 "$user_message\n".
47 "IP: $ip\n";
49 $headers = "From: $from \r\n";
50 $headers .= "Reply-To: $visitor_email \r\n";
52 mail($to, $subject, $body,$headers);
54 header('Location: thank-you.html');

New php-forum User
New php-forum User
Posts: 3
Joined: Tue Nov 08, 2011 1:15 am

Protect Your Online Accounts from Phishing Scams

Postby charlenexz » Tue Nov 08, 2011 10:52 pm

Protect Your Online Accounts from Phishing Scams UGG Womens Classic Tall red sale in my store
What is phishing? Phishing involves the sending of an e-mail falsely claiming to be from an established legitimate computer in an attempt to scam the user into surrendering private information that will be used for identity theft. The e-mail directs the consumer to visit a Web site where they are asked to update personal information, such as passwords and credit card UGG Womens Classic Mini pink sale in my store, social security digit UGG Infants Erin Boots baby blue sale in my store, and bank account numbers. It is relatively simple to make a Web site look like the legitimate site by mocking the HTML code or by framing chapters of the pages.

Many people fall martyr to email scams devised to steal log-in message because accounts such as PayPal, eBay UGG Womens Classic Short blue sale in my store, online banking accounts and extra. Scammers mail emails to every residence they can obtain so you may receive these even if you dont have an account with the targeted corporation, site or corporation.
The scam emails reserve getting better and better in their advent. You may receive an email that pretends to be sent from eBay. The email will have all the appropriate logos and will constantly be formatted in the same access. The links within the email can even emerge to be directed to legitimate pages within eBay.
For example, e-mails supposedly from eBay claim that the user's account is about to be suspended unless they clicked on the provided link and updated the credit card information.
Recently I received an email claiming to be from PayPal. It appears to be a receipt for an eBay buy that I know naught almost. The subject line is "Receipt for Your Payment"
The body of the email included a detailing of the ebay item that had allegedly been purchased using my PayPal account. Below that was a placard that said:
If you haven't authorized this dictate, click the link beneath to argue transaction and get full refund
I prodigy how numerous people receiving a similar email would immediately click on the link provided in array to marathon the charges.
OK UGG Womens Delaine Boots Chocolate sale in my store, I know to be careful with this arrange of entity so I did not click on anything in the email. Instead I went to PayPal on my own and recorded in. Guess what? There is no log there of the purchase!
Then I started looking at the formatting of the email. When I viewed the properties of the message I found that it was really from a sender and NOT paypal. Just for it says that it is from such and at the top of the email doesn't always mean that is who it is from. The "From" label in an email can lightly be altered.
This email was formatted more like a received payment PayPal email than it was an tangible receipt. I saw by always of my other emails captioned "Receipt for your payment" and not 1 of the others was formatted like this one.
Other types of scams that involve PayPal usually involve a message about unauthorized access offers. The sender will acquaint you that something has tried to get into your account. As a outcome your account is in peril of creature "frozen". However if you click the link in the email (You are told) you will be able to enter your password to lest the wastage of your account. Naturally, those disastrous enough to give their log in information will have given it to strangers.
Remember that this namely no limited to PayPal. Users of Storm Pay, e gold, eBay and more ambition look alike emails.
Watch out for scams like this that are designed to dupe you into submitting information (like passwords) to grant the sender to way your account. Whenever you receive any suspicious messages work to your account through a new browser and along typing in the url. Never click a link in an email that is supposed to take you to your PayPal account. If you make that the rule then your account information (and asset!) will be many safer.
If you trust that you have provided emotional financial information about yourself or whichever accounts through a phishing scam, you should:
- Contact your financial tradition or account swiftly
- Contact the 3 important credit bureaus and apply that a fraud attentive be placed on your credit report.
Bureaus and call numbers are:
Equifax - 1-800-525-6285
Experian - 1-888-397-3742
TransUnion - 1-800-680-7289
- File a complaint with the Federal Trade Commission at or phone 1-877-382-4357
- You can likewise adjoin the Internet Crime Complaint Center at if you meditation you have been a victim of a phishing scam.
David Slone is the Webmaster of
Visit HonestInformation for Webmaster resources, content, obliging tutorials and more. Many treatises aboard various subjects available to use as content for your website or newsletter.

New php-forum User
New php-forum User
Posts: 140
Joined: Thu Oct 13, 2011 10:32 pm
Location: Chandigarh, INDIA

Re: Help Please with contact form to send email

Postby rupali » Tue Nov 08, 2011 11:00 pm

Reasons of errors :

1) you are executing this script on localhost and mail function will not work, it just only executes on server.

2) This code is missing,
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";

Type this code before,
$headers. = 'From: '. $from . "\r\n";

Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 1 guest