After a 2 day stalemate, I seek help!
I use WindowsXP. I live in Canada and my ISP is SaskTel. Through telnet command, it showed that they do block port 25.
I am doing a microcontroller project, that connects to a laptop, and I want to send a text when something happens.
//SUBJECT AND BODY OF EMAIL SHOULD BE LESS THAN 160 CHARACTERS TOTAL
$subject = "Text Message Subject";
$message = "Text Message Content";
//SENDS TEXT MESSAGE TO 509-863-4212
I know the email is right, as i sent a text to my phone from my hotmail account.
I do not understand webservers well.. currently I am using "EasyPHP", and have my .php file in a directory, and using the path
I get an error saying "mail function isnt working with port 25, check your SMTP …"
I have read many forums, and they all say that my ISP has it blocked. I also searched long and hard for how to get around this issue. Is it actually possible? Changing ISP is not an option. Can someone point me in a good direction with some handy tips? Anything, I am very exhausted at this point
Your trying to send from your own machine and you do not have a mail server running on it hence the reason port 25 is shut.
Do you have an account anywhere you POP/SMTP? If so you can use PHPMailer to send via that mail server.
Thanks for reply
No i do not. Can i make an account somewhere?
Do you not have an email account with your ISP? PHPMailer would allow you to configure your username/pass so you can auth through their mail server and send the email.
I guess you can either run your own mail server or try or find someone who will allow you to send mail through their server via POP before SMTP. You could also look for a free web PHP host who allow email to be sent as well and use that as a 3rd party to send the mails from.
I called my ISP, and we set up an email account. He gave me the information on the smtp name, and a user name and pass. He also said that port 587 is open for me. Does this change anything?
My php file now look like:
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "smtp.sasktel.net"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "joh"; // SMTP username
$mail->Password = "abc"; // SMTP password
$mail->From = "firstname.lastname@example.org";
$mail->FromName = "John";
$mail->WordWrap = 50; // set word wrap
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Here is the subject";
$mail->Body = "This is the HTML body";
$mail->AltBody = "This is the text-only body";
echo "Message was not sent";
echo "Mailer Error: " . $mail->ErrorInfo;
echo "Message has been sent";
Using the PHPMailer class.
I still get the same port error. Is there a step i am missing? At what point am i "connecting to the mail server"
PHPMailer is old and out of date. Check out SwiftMailer.
Also, please use [code] tags when posting code. [code] … [/code].
since port 587 is not the standard port for smtp, you need to tell SwiftMailer (or any mailer class used) that you want to connect using this port.