Change Smtp Port From 25 To 587?

May 6, 2011

My ISP have blocked port 25 for sending mails from PHP, and instead have allowed port 587 or 465 to be used. how do i force php mail function to use port 587 instead of default 25? BTW : i am on MAX OSX 10.6.6 using MAMP PRO

UPDATE : i tried changing the settings in php.ini to this

[Code]....

you see it is still trying to connect via port 25? how do i change it in mac?

ANSWER :

For those of you using MAMP and not able to send the mail from php mail() function because of port 25 being blocked by ISP (in my case) here is some information for you to solve it. as OSX uses postfix to send mails and if you plan to use external smtp server like smtp.gmail.com which i used here is what you should be doing. you need to configure Postfix to use Gmail as a relay host

a) Open MAMP and in postfix change the domain of outgoing mail to smtp.gmail.com

b) open terminal and type sudo vi /etc/postfix/main.cf this will ask for your admin password enter it and it will open main.cf in vi editor

c) press ctrl+f and come to the end of the file and bring the cursor one line down from the end and press a , the editor will now switch to insert mode to edit the file.

in main.cf append this settings

relayhost = [smtp.gmail.com]:587
smtp_tls_security_level = verify
#smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_tls_session_cache_database = btree:/var/run/smtp_tls_session_cache
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous

press :wq! and now type sudo /etc/postfix/sasl_passwd add or append you Gmail username and password in the file like this:

[smtp.gmail.com]:587 user@gmail.com:mypassword

again press :wq! to save and quit the file, and run the following command

sudo postmap /etc/postfix/sasl_passwd
sudo postfix reload

ADVERTISEMENT

Failure Of Smtp On Port 25

Aug 2, 2006

i have setup smtp on 2003 web edition, IIS. Port 25 is blocked and will not respond to any telnet open commands, so i have opened port 26 which now works fine... IS this any less secure than port 25?

View 1 Replies View Related

SMTP Port Emulation

Aug 14, 2007

I want to use my normal PHP mail scripts and such, but my ISP blocks port 25 SMTP calls.

They told me: "If your smtp server uses something other than port 25, you can use smtp.".

Is there a way to send the call on say.. port 26.. and have it recieved on port 25 to where I am sending it?

View 12 Replies View Related

Use Any Other Smtp Server And Port To Send My Mail

Nov 6, 2007

I cant send a simple mail from my pc. I dont know smtp server name and port of my ISP. Cant I use any other smtp server and port to send my mail. Wud u pls tell me the name as well as the port of such smtp server. What is the name n port of yahoo.

View 1 Replies View Related

SMTP Failed To Connect To Mailserver At Localhost Port 25

Oct 25, 2007

I dont know what I did but now I get this message Failed to connect to
mailserver at "localhost" port 25, verify your "SMTP"...

View 3 Replies View Related

Error Log Stating That It Could Not Connect To Smtp Host On Port 25

Jan 12, 2006

I have some code which sends an email to a recipient, but it is not working. I have checked the smtp host and port in the PHP.ini file and both are correct, I have also contacted my provider and know the smtp host and port are also the correct ones.

I am getting an error on apache's error log stating that it could not connect to smtp host on port 25. Notice that I am using the smtp host name, I can also ping it so I know I can get to it.

At one point, the emailing function worked, but it has now stopped working; not sure what the problem might be. I have actually created a mailtest.php with some very basic code to no avail.

View 1 Replies View Related

Warning: Mail(): Failed To Connect To Mailserver At "localhost" Port 25, Verify Your "SMTP"

Aug 31, 2006

when i execute a mail program iam getting some error as follows:

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:appservwwwmails.php on line 20

what is the solution to this problem Code:

View 6 Replies View Related

Change From - Address When Using Gmail Smtp Server?

Aug 26, 2009

I want to send an email from A to B,with HEADER and CONTENT through gmail. How to do that by PHP?

I've specified the FROM( [URL]but when I receive the email,it's still from my gmail account[URL]
$mail->From = [URL]
$mail->FromName = "Mailer";
$mail->AddAddress(" [URL]"Josh Adams");// name is optional
$mail->AddReplyTo(" [URL]"Information");

How do I change the FROM part?

View 5 Replies View Related

Warning: Mail(): Failed To Connect To Mailserver At "localhost" Port 25, Verify Your "SMTP" And "smtp_port" Setting

Jul 19, 2006

may i know what the error.. i try the sending email. but it display these error:

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 fileseasyphp1-8wwwfp2.php on line 46
Cannot send password to your e-mail address ...

View 4 Replies View Related

Failed To Connect To Mailserver At "localhost" Port 25, Verify Your "SMTP" And "smtp_port" Setting In .ini Or Use Ini_set()?

Jan 4, 2011

I used this one however

$to = "url";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: url . "
" .
"CC: url";
mail($to,$subject,$txt,$headers);

I have this error which is Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()

View 1 Replies View Related

Failed To Connect To Mailserver At "localhost" Port 25, Verify Your "SMTP" And "smtp_port" Setting In Php.ini

Jul 17, 2005

Warning: mail(): Failed to connect to mailserver at "localhost" port 25,
verify your "SMTP" and "smtp_port" setting in php.ini

in php.ini I have:

SMTP = localhost
SMTP_PORT = 25
SENDMAIL_FROM = NULL
SENDMAIL_PATH = "H:WINNTsystem32" (this is where sendmail.dll is
sitting. H is the drive with w2k)

Other PHP code on that page is working.

What else should I check?

View 6 Replies View Related

Workaround For SOAP Request Failure When Wsdl Defines Service Port Binding As Https And Port 80?

Sep 17, 2009

I am consuming a SOAP web service using php5's soap extension. The service' wsdl was generated using Axis java2wsdl, and whatever options are used during generation result in the port binding url being listed as https://xxx.xxx.xxx.xxx**:80** If I download the wsdl to my server, remove the port 80 specification from the port binding location value, and reference the local file in my soapclient call it works fine.

However, if I try to reference it remotely (or download it and reference it locally, as-is) the call fails with a soap fault. I have no input into the service side so I can't make them change their wsdl-generation process. So, unless there's a way to make the soapclient ignorant of the port, I'm stuck with using a locally modified copy of someone else' wsdl (which I'd rather not do).

View 2 Replies View Related

URL Masking - Send A Page From Port 80 To Port 6999

Feb 21, 2006

I'm sure this has been asked before but I've just signed up to this
newsgroup and done a search but can't find anything. What I'm trying to do
is to send a page from port 80 to port 6999 but I don't want the :6999 bit
to show in the URL address field. Is it possible to either mask or hide
this within the header("Location:XXX") call?

In other words, if I enter http://www.mysite.com it finds the site using the
default port 80 but the information I have is actually on port 6999 so I'm
redirecting to http://www.mysite.com:6999 but I don't want the :6999 to be
displayed.

View 17 Replies View Related

Apache Cannot Be Run. Another Web Server Is Using The Web Port Or Port Is Blocked By Filewall

Feb 18, 2008

When I start EasyPHP: "Apache Cannot be Run. Another web server is using the web port or port is blocked by filewall"...

View 2 Replies View Related

Php Mail() Problem - Warning: Mail(): Failed To Connect To Mailserver At "localhost" Port 25, Verify Your "SMTP"

Mar 15, 2007

I used dreamweaver as a tools for php coding..and Im using php version 4.3.3, Apache 2.0.47(win32) and MySQL as database. I found a problem with php mail() and the error says like this ;-
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().

View 3 Replies View Related

Warning: "Failed To Connect To Mailserver At "localhost" Port 25, Verify Your "SMTP" And "smtp_port" Setting In Php.ini"

Jun 15, 2011

im having this error after changing my settings in php.ini ans sendmail.ini ..im using xampp.... Warning: mail() [function.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:xampphtdocsminippromail.php on line 9

having the settings as the following:-
php.ini
Quote[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = smtp.gmail.com
; http://php.net/smtp-port
smtp_port = 465
; For Win32 only.
; http://php.net/sendmail-from
[Code].....

View 1 Replies View Related

Warning: Mail() [function.mail]: Failed To Connect To Mailserver At "localhost" Port 25, Verify Your "SMTP" And "smtp_port" Setting In Php.ini

Feb 6, 2006

PHP Code:

$con = "hi monday";
mail("mymail@lala.com","test imap.dll",$con,"From: [email]other@mail.com[/email]");

and the mod_imap is loaded. but the browser show:

Warning: mail() [function.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 D:Apache2htdocssendmail.php on line 2

View 10 Replies View Related

Program Not Running On A Different Server - SMTP Error: Could Not Connect To SMTP Host

Aug 20, 2010

iv written some codes on sending mails using google smtp, yahoo smtp, and aol smtp in php. its working fine. but when im trying to run the same codes on a different server and domain it is giving me the following error: SMTP Error: Could not connect to SMTP host.

View 2 Replies View Related

PHPMailer: SMTP Error: Could Not Connect To SMTP Host

Aug 13, 2010

I've used PHPMailer on several projects but now I'm stuck. It gives me the error: SMTP Error: Could not connect to SMTP host. I've tried sending email from Thunderbird and it works ! But not through PHPMailer ... Here are the settings from Thunderbird:.....

$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = SMTP_HOST; // SMTP servers
$mail->Port = SMTP_PORT; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = SMTP_USER; // SMTP username
$mail->Password = SMTP_PASSWORD; // SMTP password
[Code]...

View 3 Replies View Related

Send Email Using GMail SMTP Server - Set Pop / Smtp In Php.ini

May 4, 2011

Possible Duplicate: Send email using GMail SMTP server from PHP page i have a mac and i was wondering how i can set pop/smtp using gmails information in php.ini?

View 1 Replies View Related

Send Mail Through SMTP Using Gmails Smtp Server?

May 20, 2009

Im trying to send mail through SMTP using gmails smtp server. But the problem is I get a Failed to connect error. I dont know what I'm doing wrong. Perhaps someone could give insight of why the problem is occurringHere is my code:

Code:
<?php
[code]...

View 4 Replies View Related

SMTP Error: Could Not Connect To SMTP Host

Jun 1, 2011

I have this code, and all works well in my local server. The email is sent without any problem. But now I pass the content to webserver, and I get this error... SMTP Error: Could not connect to SMTP host. SSL is enable in the server..correct? so, what is the problem?

$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
[Code]...

View 1 Replies View Related

SMTP Error "Could Not Connect To SMTP Host" With PHPMailer

Nov 15, 2010

I am getting "SMTP Error: Could not connect to SMTP host." error while trying to send mails using GMAIL SMTP and PHPMailer.. The code is working perfectly in local environment but getting error in live (bluehost) server.

View 1 Replies View Related

Mailer Error: SMTP Error: The Following SMTP Error: Data Not Accepted?

Mar 12, 2009

The following code gives the message Mailer Error: SMTP Error: The following SMTP Error: Data not accepted. But when I replace $EmailAdd with a [URL]. The mail was sent.What's wrong with my code? I'm kind of new in php, especially in dealing with mail functions.

$sql1 = "SELECT Email_Address FROM participantable where IDno=$studId";
$result1 = mysql_query($sql1);
while ($row1 = mysql_fetch_assoc($result1)){

[code]....

View 3 Replies View Related

SSL Vs Port 80

Jul 17, 2005

I have a page that can be pulled up either on SSL port 443 or on regular
HTTP port 80.

Can I use PHP to determine through which port the page is being requested?

View 3 Replies View Related

Specify Non-standard DB Port!

Jan 11, 2007

I need to modify the function call below to specify port # 5434. Now I don't know PHP and I have tried the obvious (adding port=5434 before the dbname=%s in the sprintf portion of the call, but that didn't work, where / how to I specify the non-standard port #? Code:

View 5 Replies View Related

Port Check In PHP

Jul 17, 2005

how can i check is port number xxx opened on localhost ?

View 1 Replies View Related

Port Ping?

Jul 17, 2005

I want to check with a php script if a port / serverservice is down.
It would be great if I can check the ping time, too.

But how I can realize that?

View 9 Replies View Related

Specify The Source UDP Port Using It?

Jul 1, 2009

I need to send a message via UDP to a remote equipment. I know that if I use the same UDP port that it used while sending information to the server to write back to it the messages goes through. I am currently using:

$fp = fsockopen( $destination, $port, $errno, $errstr);
if (!$fp) {
echo "ERROR: $errno - $errstr
";
} else {
fwrite($fp, $m);
fclose($fp);
}

But in this way I have no control of which port is going to be used as the source port. In Java have one can use: client = new DatagramSocket(21000); Is there a way to do something similar using PHP.

View 2 Replies View Related

Use The COM Port For Switching?

Sep 6, 2010

Can anyone point me in the right direction as to what is all involved in developing an interface that will use the COM port to switch a set of dry contacts on and off? I have an application that I am developing at present that needs to control an external switch that uses wires. The COM port should switch between a short and an open.

View 4 Replies View Related

C# - Write To A COM Port With .Net?

Oct 30, 2009

How would I go about writing to a COM port, trying to convert the following example to .Net (C#), pecifically the PHP part? If possible is there an easier way to write out to a USB?

View 5 Replies View Related

Different Port From Different Domains?

Mar 13, 2011

I have 2 "hypothetical" domains. myname.me, and myproduct.co.nz. I have four servers forded to the ports 44, 45, 80 and 90 of my public ip address. The domains both have their A record set to my ip, so myname.me:44 and myproduct.co.nz:44 bring up the same page.

What I want, is for visitors to myname.me to see the page on the server operating on port 90, but not for them to see ":90" in the address bar. I also want visitors to a.myproduct.co.nz to see the page on the server operating on port 44, and visitors to b.myproduct.co.nz to see the page on the server operating on port 45, both without seeing the :44 or :45 (e.g. I want the pages all serverd on 80).

The servers are all apache2 with php. I guess that it would be something related to [URL].., but I am not sure how it would work with 2 servers.

View 3 Replies View Related

Mssql_connect() Port

Oct 16, 2007

anyone know what port mssql_connect() uses?

View 1 Replies View Related

Unix Crypt Port

Sep 12, 2000

I'm trying to port the unix crypt into PHP because I'm on WinNT (not my fault). I found in Java at http://208.223.9.21/jfd/crypt.html and this is what I currently have as the PHP source, but it always gives me the salt + 0 (e.g. Ts0). Code:

View 7 Replies View Related

How Do I Read From A Serial Port?

Jul 9, 2007

I've got a digital scale attached to the first serial port of my Linux
OS computer: /dev/ttyS0
How would I set up the serial port for reading data and then how would
I turn that data into a variable that I could use in a PHP program?

View 1 Replies View Related

How To Get Traffic On Port [windows]

Aug 27, 2006

I've been searching around trying to find a program to get traffic going through port (Game < Server), what I want to do is to have php act like it is the program (game) sending the traffic. In other words -- Now I have:

Game < Port < Server
I want to get data going on port so I can do:
PHP < Port < Server

So rather then running the game I could just run a small PHP script. Any tips?

View 3 Replies View Related

Scanning IP And Port Range

Dec 21, 2005

I need to create a script that scans an IP range (and in turn a range of ports for each IP) and update a MySQL Database with all IPs:Ports that are found and respond to ping.

(It's mainly going to be pinging HL and HL2 game servers, but that is an un-necessary detail). I aim to have this script on a CRON Job type thing so it's run automatically at, say, 3AM each morning.

View 4 Replies View Related

Send Sms By Phone Through Com Port

May 22, 2007

is it possible to connect com port?

View 1 Replies View Related

Serial Port Comms With PHP

Jan 5, 2007

I am trying to communicate with a GSM/GPRS modem through PHP.
I can connect to it fine, i can issue commands, Eg. AT+CMGL="ALL"

That would list all the SMS messages on the device. However, when calling the result i cant find a way to parse through the stream until the end and then STOP. I am currently looping using fgets but once it gets to the end of the response from the module it just sits there. (i presume waiting for more data!)

$ser = fopen("/dev/ttyS0","r+");
stream_set_timeout($ser, 4);
if (!$ser){
echo "port error";
}
fputs($ser,'AT+CMGL="ALL"' . "");
while (!feof($ser)) {
$buffer = fgets($ser);
echo $buffer;
}
echo "end";


Any Ideas?

View 1 Replies View Related

Check If Ip And Port Is Responded

Mar 6, 2006

I want check if a ip and it's port has responded
like we type ping xxxxxx in cmd

View 2 Replies View Related

Grabbing Content On A Port Other Than 80?

Dec 14, 2005

I've been using the following script to grab images for sometime. Recently I've changed the ports my webcams output using and needed to be able to grab their output from another page (as my company won't allow access on any other port than 80). I know I'm probably doing this totally wrong.. Code:

View 5 Replies View Related

Getting Data From A Website With A Port

Jul 23, 2006

I can't seem to get anything to work, I want to grab data from a website with a port, such as http://www.example.com:8040/, but every time I try to do so, the page does not load, it just continually says "loading..."

CURL results in the same as all the other files functions I have attempted.

View 2 Replies View Related

Mysql Port Number

Mar 7, 2007

$datahost = mysql3.freehostia.com:1234;for those who have used free hostia before how did you get around this gives me the error unexpected ':' with it the port added and when i remove the port number Warning: mysql_connect(): Unknown MySQL Server Host 'mysql3freehostiacom' (1) in /home/www/rafiki.freehostia.com/register.php on line 37
Unknown MySQL Server Host 'mysql3freehostiacom'any fix's for ahh.

View 2 Replies View Related

Getting Apache Hostname And Port

Apr 2, 2006

Does anybody know how to get the apache2 hostname and port which shows on the phpinfo();

not the $_SERVER['SERVER_NAME'];

but the actual hostname from the apache conf.

View 1 Replies View Related

Ping+Port Routine

Sep 21, 2005

I just need to be able to loop/ping each respective server via a specific port (2934 or 2935) to see whether the server is still "live", so the hosters don't have to manually update their status on the site. Everything I've seen seems overly complex. Efforts so far have returned info via a traditional PING, but I can't seem to find an easy way of getting the required *port* info. The script would have to run from a regular hosted site, so I wouldn't have much access to the server's "innards".

View 13 Replies View Related

ADVERTISEMENT