Thread: Email problem

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    71
    Rep Power
    15
    I'm trying to send html formatted email from my script. Script every time reports that email has been send successfully, just if I send it to web based email accounts (hotmail.com, myownemail.com...) it never arrives. Only if I send email to my address with which I'm using Microsoft Outlook it works fine.

    Here is the code:
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    open (MAIL, "|$mailprogram -t");
    print MAIL "To: $FORM{'prima'}n";
    print MAIL "From: $FORM{'salje'}n";
    print MAIL "Subject: $FORM{'subjekt'}n";
    print MAIL "Content-type: text/htmlnn";
    print MAIL "<html><body><P>$FORM{'tekst'}</P>n";
    print MAIL "<font size="2">___________________________________________<BR>n";
    print MAIL "Email sent by <A HREF="http://www.upitnik.net</font><BR>n";" TARGET=_blank>www.upitnik.net</font><BR>n";</A>
    print MAIL "<font size="1">IP: $ENV{'REMOTE_ADDR'}, Time: $vrijeme CET</font></P></body></html>n";
    close (MAIL);

    print "Content-type: text/htmlnn";
    print "<B>Email sent !</B><P>";
    print "To: $FORM{'prima'}<BR>";
    print "From: $FORM{'salje'}<BR>";
    [/code]
  2. #2
  3. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    Your code looks fine to me.

    >>Script every time reports that email has been send successfully

    How do you know if sendmail really sends emails successfully?

    You at least need to change this line to ->
    open (MAIL, "|$mailprogram -t") &#0124; &#0124; &error("Can't open $mailprogramn");
    and add an error subroutine.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    71
    Rep Power
    15
    I have reduced code to this, and it still sends email only to my POP3 account (webmaster@upitnik.net), but email never arrives to any other address: (@hotmail.com, @mail.com, @dotcomemail.com, @myownemail.com)


    $mailprogram = '/usr/lib/sendmail';

    open (MAIL, "|$mailprogram -t") | | &dienice("Error in mail program.n");
    print MAIL "To: $FORM{'prima'}n";
    print MAIL "From: $FORM{'salje'}n";
    print MAIL "Subject: $FORM{'subjekt'}nn";
    print MAIL "Is it OK?n";
    close (MAIL);

    print "Content-type: text/htmlnn";
    print "<B>Email sent!</B><P>";
    print "To: $FORM{'prima'}<BR>";
    print "From: $FORM{'salje'}<BR>";
    exit;

    I have sub dienice just for case, but everything seems to work fine.
    You can run this script from http://www.upitnik.net/email
    Could someone please tell me is it working for your email address, or what could be cause for this...



    [This message has been edited by Pepe (edited September 18, 2000).]
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    71
    Rep Power
    15
    It must be mail server error, because this script started to work few days later and I didn't modify it at all...
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Location
    In nederland
    Posts
    41
    Rep Power
    15
    Looks to me as a server configuration error.
    I had the same thing in Php. The popmail accounts from those servers check if the mail send by you is from an existing mailadres. Which in your case isn't. It is you "perl-user" on your server who send the mail. In php you could set those setting iun this way that the mail adres existed at least it seemed to exist..
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    35
    Rep Power
    15
    I head a similar problem when using low-level access to SMTP server (connect to port 25 and send headers from there). Turned out that the SMTP server would only send emails to outside addresses if the domain specified in the HELO message (first message in SMTP protocol) specified an existing domain.
    Maybe something similar applies here?

    Ton

IMN logo majestic logo threadwatch logo seochat tools logo