When I am sending an email from my yahoo, gmail or hotmail account, it is sent.
Now I have written a PHP (I am learning php), which sends an email from my yahoo account. When I run this script, instead of sending email I am getting an error.
Why am I getting such an error. What is the difference between sending email through script and from yahoo account ?
What I mean is, when I send an email from yahoo account, I am sending an email using browser only. At this time mail server is not required. But hen I send an email from mail program mail server is required. Like browser, can not mail program send mails ? A browser can connect with yahoo server and mail program can not ? Why ? what does browser have that can connect with yahoo server ? browser is using HTTP to connect with server. Can not mail program use HTTP ? Is it only browser which can use HTTP ? Does browser use SMTP or not ? Does mail program automatically use SMTP ?
Please provide answer in non technical terms and in some details please.
Thanks
sending email using PHP email script
Moderator: General Moderators
-
manishrathi
- Forum Newbie
- Posts: 6
- Joined: Mon May 14, 2012 5:16 pm
Re: sending email using PHP email script
Well, for a better answer, what error are you getting? (ex, is it simply a syntax error in php, configuration, or authentication).
Can you post the code you are using, make sure you wrap it with [ syntax = php ] [ /syntax ] (no spaces inside the brackets) and replace your actual login credentials with ****'s
-Greg
Can you post the code you are using, make sure you wrap it with [ syntax = php ] [ /syntax ] (no spaces inside the brackets) and replace your actual login credentials with ****'s
-Greg
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: sending email using PHP email script
Sending mail requires a SMTP server. For your Yahoo account, the Yahoo web server talks to the Yahoo SMTP server. You browser does not send the email -- the Yahoo SMTP server does.manishrathi wrote:What is the difference between sending email through script and from yahoo account ?
What I mean is, when I send an email from yahoo account, I am sending an email using browser only. At this time mail server is not required. But hen I send an email from mail program mail server is required. Like browser, can not mail program send mails ? A browser can connect with yahoo server and mail program can not ? Why ? what does browser have that can connect with yahoo server ? browser is using HTTP to connect with server. Can not mail program use HTTP ? Is it only browser which can use HTTP ? Does browser use SMTP or not ? Does mail program automatically use SMTP ?s
Your script is the same. It needs to connect to a SMTP server somewhere. Usually on localhost, but it could be some other accessible server. That is probably where the error is occurring.
(#10850)