[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

different port numbers

Posted on 2012-09-08
18
Medium Priority
?
536 Views
Last Modified: 2012-10-11
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->SMTPSecure = "tls";                 // sets the prefix to the servier
$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
$mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
$mail->Host = "smtpout.secureserver.net";
$mail->Port       = 80;                   // set the SMTP port for server
$mail->Username   = "me@domain.com";  //  username 

Open in new window



I am using shared hosting on two accounts and I am told
different port numbers
some ssl, tls
different hostnames (2 different for godaddy.com, 2 different for 1and1.com)

is there to create arrays/forLoops/forEachLoops  to loop through the answers
because I would have to do alot of editing just to test one smtp email
0
Comment
Question by:rgb192
  • 8
  • 3
  • 2
  • +2
16 Comments
 
LVL 6

Expert Comment

by:g3nu1n3
ID: 38379959
Your question is a tad bit cryptic, can you be a little more specific in what you are trying to do and the details of what you have setup with GoDaddy and 1and1.
0
 

Author Comment

by:rgb192
ID: 38380077
hostnames

godaddy is
smtpout.secureserver.net
smtp.secureserver.net
relay-hosting.secureserver.net

1and1
smtp.1and1.com
mrelay.pefora.net

ports
25,80,465,587

2 different usernames

SMTPSecure=ssl,tls,''

and phpmailer will tell me if I get an error 110,111 or the mail gets sent
0
 
LVL 6

Expert Comment

by:g3nu1n3
ID: 38381171
Are you saying that you want to create a loop so that you can send multiple emails via PHPMailer when the email is submitted the first time. For example, you have one form and a person fills out and then it sends that form to your different email accounts?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:rgb192
ID: 38381312
I have asked godaddy and 1and1
and each employee has a different opinion of which hostname,smtpsecure,port will work

I tried godaddy and smtp was sent using
port 80,smtpout.secureserver.net, no smtp secure
and I copy paste many combinations to make 1and1 to try to send smtp

instead of manually trying each, I want to create a loop



>>
Are you saying that you want to create a loop so that you can send multiple emails via PHPMailer when the email is submitted the first time. For example, you have one form and a person fills out and then it sends that form to your different email accounts?


no form  (but you have a great idea and I will ask a related question)
yes loop


I will create the reporting at the end of the loop

  $mail->Send();
  echo "Mail was sent.</p>\n";
} catch (phpmailerException $e) {
  echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
  echo $e->getMessage(); //Boring error messages from anything else!
}


I will echo which combination (host, smtpsecure, port) creates a send, or error message
0
 
LVL 60

Expert Comment

by:Julian Hansen
ID: 38390246
@rgb192 - I have made this comment before - your questions are too vague for us to be able to follow you - which is why I suspect you need to do so many request for follow ups.

Having read the above I still have no idea what you are asking. I could take 10min to try and figure it out but I would rather have it explained to me clearly so I can rather spend that time working on a solution.

Just my 2c worth.
0
 
LVL 36

Accepted Solution

by:
Loganathan Natarajan earned 2000 total points
ID: 38390299
I think you need dynamic way of filling the details on the variable like. It is better you design the form as like you change the port number, smtp details etc., and then you click to send mail.. so that you can place the values on the php coding.
0
 

Author Comment

by:rgb192
ID: 38390374
>>form as like you change the port number, smtp details etc., and then you click to send mail

and

>> I would rather have it explained to me clearly so I can rather spend that time working on a solution.



I have found two email hosting companies (and there are other hosting companies that I think have this problem)
that do not know which hostname,port, smtpSecure which
echo "Mail was sent.</p>\n";


  $mail->Send();
  echo "Mail was sent.</p>\n";
} catch (phpmailerException $e) {
  echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
  echo $e->getMessage(); //Boring error messages from anything else!
}


it is difficult for me to create a form because I do not know which combination to use
so I have to guess and check


My question is to loop through all the values to see what phpmailer error number or which values send email
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 38390398
mmm, loop through may not work or cannot check properly.

you can create multiple variable like each provider settings as each variable like mail1, mail2 .. then you send and track the error.
0
 
LVL 29

Expert Comment

by:fibo
ID: 38390992
Assuming you simply want to send email from php and looking for the solution with your hosting companies:

1 - It is probably simpler to test one after the other (not THAT many combinations) rather than to array things...

2 - I have some doubts for port 80 usually this is http rather than smtp

3 - The hotline of your hosting companies do certainly know how to give the precise answer, maybe some details you give them place them out of trajectory: the answers are usually very simple and should not overflow you with all these ssl and tls. Basically there are for each hosting company only TWO answers: one for regular non secure smtp (usually port 25) and the other one thru ssl-secured smtp (usually port 587). (see http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol )
Of course, each hosting company might decide, for security reasons, to have different port numbers... but it is still only TWO per hosting company.

4 - Sending mail by php mail() might be tricky if some headers are not correctly formatted, ie separated with the proper \n and/or \r combination. Have a look at http://www.php.net/manual/en/function.mail.php and the comments to get a better vision of some tricks
0
 

Author Comment

by:rgb192
ID: 38391527
>>- It is probably simpler to test one after the other (not THAT many combinations) rather than to array things...

godaddy worked for me with

port 80,smtpout.secureserver.net, no smtp secure

I tried other settings and got phpmailer 110,111 errors


>>The hotline of your hosting companies do certainly know how to give the precise answer,

I sent numerous emails with answers of different combinations
and I tried some copy paste combinations for 1and1.com with no luck


>>you can create multiple variable like each provider settings as each variable like mail1, mail2 .. then you send and track the error.

could you show me example
0
 

Author Comment

by:rgb192
ID: 38404209
Is there a way to do a loop or use a database to interate through the 3 values
Hostname, port, smtp (ssl or tls)
0
 

Author Comment

by:rgb192
ID: 38476417
hostgator writes
http://support.hostgator.com/articles/specialized-help/email/outlook-eudora-thunderbird-mac-ipad-phone-client-settings

Outgoing mail port: 25 (If 25 does not work, try 26, as some ISPs block port 25)
0
 
LVL 29

Expert Comment

by:fibo
ID: 38476438
Your question seemed to mean that you have a smtp problem that you are tryong tpo solve by sending mail from one of your 2 ISPs

You have been given hints that would allow you to find by trial and error which combinations are working on these 2 ISPs.

Howvere you do insist on finding a looping solution: this hints at a totally different problem, exploring ports on servers.
On well configured servers, multiple tests on multiple ports will ring alarm bells and be interpreted as some hacking / pirating attempts, and might lead to your IP address to be banned for somewhile: somtehing between 15 minutes and 2 days will be common.
0
 

Author Comment

by:rgb192
ID: 38478789
My plan is to save the working settings.  I am looking to move away from gmail
Host gator admits port 25 or port 26 only will work


 http://support.hostgator.com/articles/specialized-help/email/outlook-eudora-thunderbird-mac-ipad-phone-client-settings
0
 
LVL 29

Expert Comment

by:fibo
ID: 38480573
Since there are around 4 - 6 combinations to test... do that manually, it will just be 30 minutes...
0
 

Author Closing Comment

by:rgb192
ID: 38488825
best answer, create a form

thank you
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses
Course of the Month17 days, 14 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question