dumdumsareyum Posted July 4, 2007 Share Posted July 4, 2007 Ok, I'm trying to figure out how to get php to send an email for the first time . I followed the instructions listed here: http://deepakssn.blogspot.com/2006/06/gmail-php-send-email-using-php-with.html Now when i get run the program i get this: Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?) in C:\wamp\www\class.smtp.php on line 106 Mailer Error: Language string failed to load: connect_host i went into the php.ini file and uncommented the line extension=php_openssl.dll but that didn't work I looked in the php documentation and it said I needed to download openssl so I downloaded an executible version and now it's on my pc but I don't think it's really doing much to improve my situation.... I also added the path to my php in the control panel--system variables--path area and I get the same warning as before. What should I do? Thanks Quote Link to comment Share on other sites More sharing options...
dewey_witt Posted July 5, 2007 Share Posted July 5, 2007 OK here is something that send mail rather nicley. If you need checks and ballances you can find some additional code in the php tutorials here on phpfreaks. <?php // send an e-mail $msg = "A User Has dome something.\nThe information is:\n\n"; $msg .= "First name: " . $_POST[FName] . "\n"; //these are some sample variables \\for amusment purposes. this is data input froma form and sent in mail. $msg .= "Lastname: " . $_POST[LName] . "\n"; $msg .= "Email: " . $_POST[Email] . "\n"; $msg .= "Organization: " . $_POST[Org] . "\n"; $msg .= "Address: " . $_POST[Addy] . "\n"; $msg .= "City: " . $_POST[City] . "\n"; $msg .= "State: " . $_POST[state] . "\n"; $msg .= "Zip: " . $_POST[Zip] . "\n"; $msg .= "Phone: " . $_POST[Phone] . "\n\n"; $to = "some_name@some_domain.com"; $subject = "Some_Subject"; $headers = "From: someone@sumdomain.com\n"; $headers .= "Reply-To: someone@somedomain.com\n\n"; mail($to, $subject, $msg, $headers); \// this sends the user to whatever url you want them to go to after thay have made their post or provided input. header( "Location: http://www.somedomain.com"); exit; } // CLose the php block. ?> Hope it helps Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.