Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

phpmailer. can not connect to server

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have this contact.php file which processes the data coming from a form. This file tries to send the entered information to an email using PHPMailer (If they are validated). here is the code snippet:


and here is the error it throws:



I am new at this so please give me a clear answer or examples! I have searched a lot, but still couldn't solve it!
any help or suggestion would be deeply appreciated!
Thank you so much!

Sahar.
 
Ranch Hand
Posts: 71
PHP Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are a couple of suggestions:

1) Are you sure you have the correct hostname? Try doing

ping mail.mysite.co

and see if you get a result. (The name lookes starnage to me, usually the last part should be .com)

2) Are you sure that port 25 is open and not blocked by a firewall? Try this to see if the port is accessible:

telnet mail.mysite.co 25

If it accessible you will get some result (gibbersh, screen refresh). If the port is not accessible, you will get a connection error.

3) Are you sure you have the correct username and password (mailer@mysite.co/mysite23) to connect to mail server? Some mail servers only want the name and not the "@hostname" portion to log in.

4) Do you own mail.mysite.co? If so, what OS is it running? If you don't own it, are you sure that you have access to it? I ask because if that site is running MS Exchange you might not have the necessary access rights (I run into that all the time at work - I cannot programmatically access the same Exchange server that Outlook has access to so we have configured a gateway system that we use when testing email code or configuring other apps to send emails).
 
What I don't understand is how they changed the earth's orbit to fit the metric calendar. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic