473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Send Text with PHP, Port 25 block issue

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.

PHP file:

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. <?PHP
  4.      //SUBJECT AND BODY OF EMAIL SHOULD BE LESS THAN 160 CHARACTERS TOTAL
  5.      $subject = "Text Message Subject";
  6.      $message = "Text Message Content"; 
  7.  
  8.      //SENDS TEXT MESSAGE TO 509-863-4212
  9.      mail("5098624212@sms.sasktel.com",$subject,$message,"From: email@site.net");
  10. ?>
  11. </body>
  12. </html>

****

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

http://localhost/test/sendtext.php

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


Thank you,


John
Feb 26 '09 #1
6 4780
hoopy
88
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.
Feb 26 '09 #2
@hoopy
Thanks for reply

No i do not. Can i make an account somewhere?
Feb 26 '09 #3
hoopy
88
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.
Feb 26 '09 #4
Okay.

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:

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. <?php
  4. require("class.phpmailer.php");
  5.  
  6. $mail = new PHPMailer();
  7.  
  8. $mail->IsSMTP(); // send via SMTP
  9. $mail->Host = "smtp.sasktel.net"; // SMTP servers
  10. $mail->SMTPAuth = true; // turn on SMTP authentication
  11. $mail->Username = "joh"; // SMTP username
  12.  
  13. $mail->Password = "abc"; // SMTP password
  14.  
  15. $mail->From = "johash@sastel.net";
  16. $mail->FromName = "John";
  17. $mail->AddAddress("3065418450@sms.sastel.com","Waste");
  18. $mail->AddReplyTo("johnhas@sastel.net","Your Name");
  19.  
  20. $mail->WordWrap = 50; // set word wrap
  21.  
  22. $mail->IsHTML(true); // send as HTML
  23.  
  24. $mail->Subject = "Here is the subject";
  25. $mail->Body = "This is the HTML body";
  26. $mail->AltBody = "This is the text-only body";
  27.  
  28. if(!$mail->Send())
  29. {
  30. echo "Message was not sent";
  31. echo "Mailer Error: " . $mail->ErrorInfo;
  32. exit;
  33. }
  34.  
  35. echo "Message has been sent";
  36.  
  37. ?>
  38.  
  39. </body>
  40. </html>

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"
Feb 26 '09 #5
Markus
6,050 Expert 4TB
PHPMailer is old and out of date. Check out SwiftMailer.

Also, please use [code] tags when posting code. [code] ... [/code].

Thank you,

Markus.
Feb 26 '09 #6
Dormilich
8,658 Expert Mod 8TB
@swightness
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.
Feb 27 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Quarco | last post by:
Hi, Quick & simple question: I have to send the next data to a socket in order to make a popup visible on a windows machine.. TITLE Title of popup TEXT Text in popup POPUP
4
by: CK | last post by:
Hi all, I know this question is stupid. But i need some advice for this. I am trying to develop a website, which will allow the user send to order form to the admin email. I am planning to use the...
1
by: kiran | last post by:
Hi all, I have a problem to communicate with serial port(COM3:). I am able to open the handle but cannot send any data. 1. I connected my motoroala handset to PC through datacable. 2. I...
0
by: Gregory Hassett | last post by:
Hello, I want to periodically send a TCP packet to a peer, always from the same source port. That is, each packet will come from my local ip address, port 8801, and go to the peer's ip address,...
2
by: David Lozzi | last post by:
Howdy, I'm new to .Net 2.0... Getting "System.Net.Mail.SmtpException: The operation has timed out" on this script at the smtpClient.Send(msg) line Dim msg As New MailMessage
14
by: eliss.carmine | last post by:
I'm using TCP/IP to send a Bitmap object over Sockets. This is my first time using C# at all so I don't know if this is the "right" way to do it. I've already found out several times the way I was...
7
by: oopsbabies | last post by:
Hello everyone, I am using Apache 1.3.33 as the web server and PHP version 4.3.10. My machine is using Windows XP 2002 professional edition which comes with a Windows firewall. I am using McAfee...
16
by: =?Utf-8?B?Q2hlZg==?= | last post by:
I can use outlook2003 to send email,but I cann't use this code below to send email. Please help me to test this code and instruct me how to solve this problem in detail. software...
6
by: terry | last post by:
Hi, I am trying to send a character to '/dev/ttyS0' and expect the same character and upon receipt I want to send another character. I tired with Pyserial but in vain. Test Set up: 1. Send...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.