Jump to content
Stef's Coding Community
Sign in to follow this  
kirsiskaspars

email function

Recommended Posts

Hello!

 

I'm working with killersites video tutorial and just turned to a little problem.

At the moment I have to work with email function. I am learning how to manage to

send smth to email adress.

 

Script that I wrote:

 

<?php

 

$words = " many words in this sentence...";

$result = str_word_count($words);

echo $result . "<br><br>";

 

$did_send = mail('kirsiskaspars@gmail.com','Killerphp.com Test Email', "The body message.");

 

echo " Email sent: ". $did_send;

 

?>

 

 

In the video everything based on this script works just fine, but

I have an issue which you can see in the picture (attachment)

 

I am a begginer in php, so really need your help.

 

Thank you!

post-40522-064354200 1334082266_thumb.gif

Share this post


Link to post
Share on other sites

In my experience, PHP's mail() function is something that is best used on an actual web server, not on your local machine running WAMP. It is possible to get the local server to send you emails, but it's a bit of a tricky process that requires editing your PHP.ini file with your SMTP/SMTP port details. If you aren't getting any errors other than that one, I think you can safely assume that the mail() function is working correctly, and you should receive email properly if you put the PHP file on an actual web server.

Share this post


Link to post
Share on other sites

In my experience, PHP's mail() function is something that is best used on an actual web server, not on your local machine running WAMP. It is possible to get the local server to send you emails, but it's a bit of a tricky process that requires editing your PHP.ini file with your SMTP/SMTP port details. If you aren't getting any errors other than that one, I think you can safely assume that the mail() function is working correctly, and you should receive email properly if you put the PHP file on an actual web server.

 

Thanks!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...