Jump to content

send email from localhost


C32

Recommended Posts

can I send a genuine email to a nonlocal adress? I use XAMPP and I could send an email to newuser@localhost (btw: where can I find the email back?) but when I try to send it to an existing email of myself online, I got an error.I also have uploaded that php form to test it online, but the email never arrive in my inboxwhat is the problem?

Link to comment
Share on other sites

can I send a genuine email to a nonlocal adress? I use XAMPP and I could send an email to newuser@localhost (btw: where can I find the email back?) but when I try to send it to an existing email of myself online, I got an error.I also have uploaded that php form to test it online, but the email never arrive in my inboxwhat is the problem?

I use xampp to test my files. I can send an email using the mail function in php. You could try sending it to me(snowfortbuilder@gmail.com). you should also look in junk mail or spam box. sometimes mail sent by unkown servers is considered junkmail.try using the script below. I will try to reply if i get the message.
<?php$to      = 'snowfortbuilder@gmail.com';$subject = 'Can I send an email with xampp';$message = 'hello my email is webmaster@example.com';$headers = 'From: webmaster@example.com' . "\r\n" .mail($to, $subject, $message, $headers);?>

Link to comment
Share on other sites

You would need to post your code to help with the online thing.Locally, you probably will not have any success sending email out on your own server, most residential ISPs block the outgoing mail port.

I used the similar code as SFB did, most basic thing. I tried it online on a free host and there was no error, but the email never arrived.. I checked the junkmail too.
<?php$to = "myname@hotmail.com";$subject = "Test mail";$message = "Hello! This is a simple text message.";$from = "myname@hotmail.com";$headers = "From: $from";mail($to,$subject,$message,$headers);echo "Mail Sent.";?>

Link to comment
Share on other sites

it may be your php.ini file. I have never been able to send email on xampp because I could never get the php.ini set to what it needed to be; it always threw an error. as for your host, I have the same problem. the email seems to send fine, but I never get it. don't know why.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...