Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old September 18th, 2000, 09:35 AM
Pepe Pepe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 71 Pepe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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]

Reply With Quote
  #2  
Old September 18th, 2000, 07:08 PM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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") | | &error("Can't open $mailprogramn");
and add an error subroutine.

Reply With Quote
  #3  
Old September 18th, 2000, 08:39 PM
Pepe Pepe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 71 Pepe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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).]

Reply With Quote
  #4  
Old September 19th, 2000, 10:38 PM
Pepe Pepe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 71 Pepe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
It must be mail server error, because this script started to work few days later and I didn't modify it at all...

Reply With Quote
  #5  
Old September 22nd, 2000, 02:40 AM
jochum jochum is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Location: In nederland
Posts: 41 jochum User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 2 sec
Reputation Power: 9
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..

Reply With Quote
  #6  
Old October 2nd, 2000, 08:24 AM
tvanbart tvanbart is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Posts: 35 tvanbart User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Email problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway