+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Email script not working

  1. #1
    fake01 is offline x10Hosting Member fake01 is an unknown quantity at this point
    Join Date
    Dec 2009
    Posts
    24

    Email script not working

    So I have an email script which sends a welcome email along with activation link after a user creates an account. However, the registration process works fine but no email get's sent. The script is:

    PHP Code:
    function sendWelcome($user$actkey$email){
          
    $from "From: ".EMAIL_FROM_NAME." <".EMAIL_FROM_ADDR.">";
          
    $subject "insight - Welcome!";
          
    $body $user.",\n\n"
                 
    ."Welcome! You've just registered at insight with the following information\n\n"
                 
    ."Username: ".$user."\n"
                 
    ."You must activate this account before you can use it. To do this click on\n"
                 
    ."the link below.\n\n "
                 
    ."http://insight.pcriot.com/activate.php?i=".$user."&id=".$actkey."\n\n"
                 
    ."- insight";

          
    mail($email,$subject,$body,$from);

    Is there something wrong with it? I've used it before when I first began creating the registration form and it worked. However since fixing a lot of it up it's stopped working. The script is executed with:

    PHP Code:
     if(EMAIL_WELCOME){
                   
    $mailer->sendWelcome($subusersha1($subuser.$subemail.DB_SALT), $subemail);


  2. #2
    dibb3386 is offline x10Hosting Member dibb3386 is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    61

    Re: Email script not working

    Where you have '$from = "From: ".EMAIL_FROM_NAME." <".EMAIL_FROM_ADDR.">";' LINE 2

    Try change to:-

    $from = "From: inSight <myemail@address.com>";

  3. #3
    fake01 is offline x10Hosting Member fake01 is an unknown quantity at this point
    Join Date
    Dec 2009
    Posts
    24

    Re: Email script not working

    Quote Originally Posted by dibb3386 View Post
    Where you have '$from = "From: ".EMAIL_FROM_NAME." <".EMAIL_FROM_ADDR.">";' LINE 2

    Try change to:-

    $from = "From: inSight <myemail@address.com>";
    Well after hours of testing I think I have figured it out. For some unknown reason everytime I put the email address as @gmail or @hotmail, it doesn't work. but I can use anything else like @example or @test etc and it works.

    I just have no idea why. I have nothing on my script which tells it to prevent sending gmail or hotmail emails addresses. I can send to gmail or hotmail accounts, I just can't have my email address (for From: ) as a gmail or hotmail address.

    Is mailer or something preventing me sending emails as my gmail or hotmail email address?

    Edit:
    OK, I can now confirm that anything ending with @gmail or @hotmail in the $from field will NOT send. This was not an issue before the server upgrades. Has something changed to do this?

    I'm quite happy with the upgrade as phpMyAdmin works MUCH faster now and is easier to use. But it's a disappointment that the script won't work with @gmail or @hotmail.
    Last edited by fake01; 02-11-2010 at 10:09 AM. Reason: Automerged Doublepost

  4. #4
    xgreenberetx is offline x10Hosting Member xgreenberetx is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    57

    Re: Email script not working

    I'm guessing them sites black listed the domain, or x10 does not allow it using them email extensions.

  5. #5
    fake01 is offline x10Hosting Member fake01 is an unknown quantity at this point
    Join Date
    Dec 2009
    Posts
    24

    Re: Email script not working

    Any way to find out if x10hosting has blocked those extensions? and anyway to see how to unblock them?

  6. #6
    rkalhans's Avatar
    rkalhans is offline x10Hosting Member rkalhans is an unknown quantity at this point
    Join Date
    Dec 2009
    Posts
    33

    Re: Email script not working

    I guess i know the problem
    They must be going to the spam mail box, (check for God's sake coz this is silly)
    ;)
    moreover to sort out the problem, put the proper headers, check out some site with tutorials, I wont post in the link as some of the Admins here have problems with that (I dont know the reason).
    and I guess you will be fyn.

    If you find this post helpful try adding to my reputation, I have been doing this thankless job for a while now. :cool:

  7. #7
    fake01 is offline x10Hosting Member fake01 is an unknown quantity at this point
    Join Date
    Dec 2009
    Posts
    24

    Re: Email script not working

    Quote Originally Posted by rkalhans View Post
    I guess i know the problem
    They must be going to the spam mail box, (check for God's sake coz this is silly)
    That's also another weird problem, some go to spam others go to normal place. And yes I do check spam and I can assure you ANYTHING with @gmail or @hotmail will NOT send, either to spam or normal place, I've checked at leats 50 times over several hours after making adjustments etc.
    ;)

    Quote Originally Posted by rkalhans View Post
    moreover to sort out the problem, put the proper headers, check out some site with tutorials, I wont post in the link as some of the Admins here have problems with that (I dont know the reason).
    I don't need a tutorial on how to create an email script. I said the email script works and sends emails to email addresses. It just doesn't send them if I put the sender as @gmail or @hotmail (I haven't tried other email services).

    Here:

    PHP Code:
    function sendWelcome($user$actkey$email){
          
    $from "From: ".EMAIL_FROM_NAME." <".EMAIL_FROM_ADDR.">"//THIS IS THE PROBLEM
          
    $subject "insight - Welcome!";
          
    $body $user.",\n\n"
                 
    ."Welcome! You've just registered at insight with the following information\n\n"
                 
    ."Username: ".$user."\n"
                 
    ."You must activate this account before you can use it. To do this click on\n"
                 
    ."the link below.\n\n "
                 
    ."http://insight.pcriot.com/activate.php?i=".$user."&id=".$actkey."\n\n"
                 
    ."- insight";

          
    mail($email,$subject,$body,$from);

    If .EMAIL_FROM_ADDR. == anyname@gmail.com OR anyname@hotmail.com it will NOT send. However if I put it as anyname@lol.com or anyname@itworks.com or some other random thing it WORKS.


  8. #8
    xgreenberetx is offline x10Hosting Member xgreenberetx is an unknown quantity at this point
    Join Date
    Oct 2009
    Posts
    57

    Re: Email script not working

    Just put the name of your site for the from addy, and in the email message include the real email to reply to?

  9. #9
    rkalhans's Avatar
    rkalhans is offline x10Hosting Member rkalhans is an unknown quantity at this point
    Join Date
    Dec 2009
    Posts
    33

    Re: Email script not working

    Just put the name of your site for the from addy, and in the email message include the real email to reply to?
    This has to be done using headers in the mail function (this and a few other modifications is what i wanted to refer to in my last post),

    @fake01
    I don't need a tutorial on how to create an email script.
    Sure you don't need to write a script to send an email, but you do need to refer to some tutorials if you want to create an email script that's not blocked by Gmail and Hotmail, and that's not marked as spam. :cool:
    All the best
    Add to my reputation if you found this post helpful, ( click the button at left bottom)
    My Blog:
    My Homepage
    :

  10. #10
    fake01 is offline x10Hosting Member fake01 is an unknown quantity at this point
    Join Date
    Dec 2009
    Posts
    24

    Re: Email script not working

    Quote Originally Posted by rkalhans View Post
    @fake01
    Sure you don't need to write a script to send an email, but you do need to refer to some tutorials if you want to create an email script that's not blocked by Gmail and Hotmail, and that's not marked as spam. :cool:
    All the best
    Well I might as well mention also that I also used the email script from w3schools and got the exact same results;).

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Email not working and messed up domain
    By chaemus in forum Free Hosting
    Replies: 0
    Last Post: 11-20-2008, 04:56 AM
  2. Email Account Not Working!!! Can't Send/Receive!!!
    By WeR1Family in forum Free Hosting
    Replies: 0
    Last Post: 05-30-2008, 05:00 AM
  3. My Email account is not working!
    By teclanka in forum Free Hosting
    Replies: 0
    Last Post: 05-29-2008, 12:46 PM
  4. Email forwarding now working?
    By kscott in forum Free Hosting
    Replies: 1
    Last Post: 10-01-2007, 05:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers