Dynadot โ€” .com Registration $8.99

Sending mail

Spaceship Spaceship
Watch

Albino

Munky DesignsEstablished Member
Impact
17
hey
im trying to make a sending mail form, but im confused

I keep getting this err:

Warning: 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:\Program Files\Apache Group\Apache2\test\Testsite\TMPjrmj7mjxi8.php on line 31
email error

and ive hada look in my php.ini file, but ive no idea what to change.

also, as an added thing, ive seen this :

PHP:
function checkemail($eemail) {
    if(eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$",$eemail))  {
      return true;
    }

and i was wondering if someone could explain this for me,

thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
In the php.ini file, you configure your SMTP (outgoing) email server... It can't make a connection to it, so PHP is having a problem sending out your email. The line of code that you posted doesn't have anything to do with it.

Are you running on Linux/Unix or Windows? If your running on Windows, I don't believe there is an SMTP server on (by default anyways)... use your ISP's SMTP server. Check your email settings in your mail app and look for the SMTP server in the settings, then put that server on the line in your php.ini file that reads:

SMTP = localhost

So if your SMTP server for your ISP is "mail.myisp.com" then change that line to read

SMTP = mail.myisp.com

That should fix you up...
 
0
•••
my isp is my machine though

and the code wasnt anything to do with that, it was a completely unrelated matter.

so, as my server is my machine, what would it be/

sorry to sound stupid, lol
 
0
•••
You have to get your internet connection from somewhere, I'm assuming your on a cable or dsl line... Unless you truly are your own ISP with a leased line...

In any case, if you're running windows, setup an SMTP server (http://www.softstack.com/freesmtp.html)

If you're running linux, you should already have sendmail setup and running... what's your platform, and what do you mean by you're your own ISP?

Also, that function of code you posted is just checking for a valid email structure (anything @ anything . com)... If it's a valid structure (not necessarily a valid email address) it returns true.
 
0
•••
haha, i got a bit confused

im on tesco, so have no idea what the SMTP would be
im also on windows

Ok, i got that program, and I get this error:

Warning: mail(): SMTP server response: 550 Invalid recipient: [email protected] in C:\Program Files\Apache Group\Apache2\test\Testsite\email.php on line 31

im pretty sure ive made a stupid error

cheers for helping so far :D
 
0
•••
That just means that the SMTP server isn't setup correctly... I'm not familiar with that software, so I can't help you with that.

However, tesco, whoever that is, should have provided you with an smtp server... I mean, they provided you an email account, right? Whether or not you use that email account, they still have to provide you an smtp server to send the mail...

Check your ISP's webpage, look for the address to the smtp server, it's usually something like 'mail.yourisp.com' or 'smtp.yourisp.com'...

That will fix your problem, I can't help with the smtp server software setup though because again, I don't use that.
 
0
•••
ok, thanks

i guess youre american?

tesco is a supermarket like walmart.

i shall look up at their site about the SMTP, and ive checked and rechecked the software, and there isnt really much to set up, lol

anyway, thatnks for all your help :D
 
0
•••
yeah, you should find it in your mail app, do you use outlook? thunderbird?
 
0
•••
erm, none

i use hotmail
 
0
•••
alright, well anyways, that's your problem, no smtp server to send mail through... you could also try finding a free copy of sendmail for windows, which I know exists because I've used it, just can't seem to find it out there... that might help you as well...

Good luck!,
Mike
 
0
•••
ah right, lol

thanks for everything :D
 
0
•••
Dynadot โ€” .com Registration $8.99Dynadot โ€” .com Registration $8.99
Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back