Two problems

Discussion in 'H-Sphere Shared Hosting' started by lazy, May 22, 2003.

  1. lazy

    lazy Guppy

    Hi!
    i am having a problem with the PHP mail function. i cannot use it to send mail.
    i get that the SMTP server is unable to rely my email.
    Check it out here:
    http://umm.biz/mail.php


    I have created, by somehow, two mySQL dbs. The first DB information and space quote are not included in the control panel.
    i am not a thief and i dont wanna rob you guys. So can you remove the empty database (its name is lazy) and make the first DB (named as test) as my default database?!
    Thanks
  2. Yash

    Yash Bass

    Hi

    Could you please tell me what arguments you passed for the mail function. I'll give it a look.

    as for two MySQL databases, I dont think that is possible without you being billed. If you accidently added a second database, you would have been emailed with a new invoice and would have been made to agree to those new charges.
  3. lazy

    lazy Guppy

    no there was no invoice sent. in fact when i first signed in the control panel i noticed that there is already a database called test is set up.

    about the mail function, here is the code:
    PHP:
    <?php 
    $mailheaders 
    "From: Layz <[email protected]>\nX-Mailer: mohammed jassim mj-smile.com\nContent-Type: text/html;";

    mail("[email protected]","sdf","sdfsd",$mailheaders); 
    ?>
  4. Yash

    Yash Bass

    I'm looking into the PHP problem and would get back to you a little later
  5. Yash

    Yash Bass

    You are going to have to authenticate with the SMTP server before sending the email. The POP3 Username/password can be used to authenticate
  6. lazy

    lazy Guppy

    How i can do that?! ?(
    Do u mean that i will have to use fsockopen function to query the SMTP server?!!
  7. Yash

    Yash Bass

    OK. that is a tough question. The problem is we dont have any PHP developer here.

    There is a PHP function that sends email through an SMTP server and allows you to provide authentication parameters. This forum (burning board 2.0.2) uses the same method to send out emails. I suggest that you visit http://www.phpbuilder.com and ask your question. A very popular PHP forum
  8. lazy

    lazy Guppy

    Yeah i know, i am running an ipb forum that uses the same method. im gonna steal its function :D
    Thanks
  9. Yash

    Yash Bass

    Ok, we found out why the mail function wasnt working in your case. You are hosted on one of our windows server (i thought otherwise) and Windows SMTP requires you to authenticate if you want to use it. Thats why we hate installing PHP on windows.
    However, you can of course still send email authenticating the way I mentioned above. I noticed that the way this forum is configured (it too is on one of our windows servers), we just specified our smtp server (mail.jodohost.com) and it started sending email through that without authentication. So you can give that a try too.
  10. StPatrick

    StPatrick Perch

    Looking at this forum, I realized that I have the same problem, but with ASP.NET. The built-in ASP.NET functions (System.Web.Mail), don't have any parameters that can be used to authenticate against SMTP server (unfortunately :( ). I was searching over the net, but seems there are no much answers for this. Well, there is a way - using CDO directly, which I'm gonna try now, but maybe I'm wrong here?
  11. Yash

    Yash Bass

    I'll be checking that out for you.
  12. Yash

    Yash Bass

    Ok, that problem is only with PHP on Windows and not ASP.NET

    Anyway, we modified something on win1 and win2. Tell me if it works now.
  13. StPatrick

    StPatrick Perch

    Yep, works like a charm now
    Thank you :rolleyes:
  14. EmilianoLedo

    EmilianoLedo Guppy

    Hello Yash!
    How are you doing?
    :)

    So... could you please check win7 and do the same thing (if applicable)? I ask you this because today I got 3 people complaining about email messages not received and I got this error:

    warning: mail(): SMTP server response: 553 sorry, that domain isn't allowed to be relayed thru this MTA (#5.7.1) in...


    my domain is novayork.com, I'm using PHP/Win.


    In my php.ini I had:

    ini_set("SMTP", "mail.jodohost.com");
    ini_set("smtp_port", "25");
    ini_set("sendmail_from", "[email protected]");

    But now I cleaned it up...

    Thanks,
    Regards,
    Emiliano.
  15. Stephen

    Stephen US Operations Staff Member

    the mailserver requires authentication, your best bet it to use localhost, or the phpmailer class at http://phpmailer.sf.net

    You can use an ini_set in your file to set the ini to include the local path to where you put the two required class files.
  16. EmilianoLedo

    EmilianoLedo Guppy

    Hi Stephen!
    Thanks for replying! :)

    Look, I'll try. I'm using Drupal and need to see how to do it with their code, but I'll find out and try.

    Thanks,
    Emiliano.

Share This Page

JodoHost - 26,000 hosting end-users in 100 countries
Plesk Web Hosting
VPS Hosting
H-Sphere Web Hosting
Other Services