Jump to content

configuring to send email


dumdumsareyum

Recommended Posts

Ok, I'm trying to figure out how to get php to send an email for the first time  :o.

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.