Gossamer Forum
Home : Products : DBMan : Customization :

Mail user mod problem!

Quote Reply
Mail user mod problem!
Hi, I have a problem with a mail a user mod.
Sendmail path is correct, that's for sure...

This is what I have.... (error is at the bottom of this message)....

Now, what am I doing wrong ?!? Thanks a lot in advance...

This part is in HTML.PL (just the relevant piece od code)
----------------------------------------------------
<form action="$db_script_url" method="POST">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid">
<input type=hidden name="$db_key" value="$in{$db_key}">
<table><tr><td align=right>
<Font face="Verdana, Arial, Helvetica" Size="2" Color="#33ff33">
Vasa e-mail adresa:</font </td>
<td> <input type=text name="email" value="$in{'email'}" size=40> </td> </tr>
<tr> <td align=right>
<Font face="Verdana, Arial, Helvetica" Size="2" Color="#33ff33">
Tema poruke:</font> </td>
<td> <input type=text name="subject" value="$in{'subject'}" size=40> </td> </tr>
<tr> <td align=right>
<Font face="Verdana, Arial, Helvetica" Size="2" Color="#33ff33">
Teskt poruke: </font> </td>
<td> <textarea name="emailmessage" cols="38" rows="5" wrap="PHYSICAL">
$in{'emailmessage'}</textarea> </td> </tr>
</table>
<center>
<Font face="Verdana, Arial, Helvetica" Size="2" Color="#33ff33">
<INPUT TYPE="SUBMIT" NAME="send_email" VALUE="Posalji poruku">
<INPUT TYPE="RESET" VALUE="Ponisti">
</font>
</center>
</form>

---------------------------



This part is in my DB.CGI
----------------------------------
sub send_email {
unless ($in{'email'}) { $message = "Morate unijeti svoj e-mail<BR>"; }
unless ($in{'email'} =~ /.+\@.+\..+/) { $message = "Vasa e-mail adresa nije u valjanom formatu. Provjerite upis!<BR>"; }
unless ($in{'subject'}) { $message .= "Morate unijeti Subject poruke!.<BR>"; }
unless ($in{'emailmessage'}) { $message .= "Morate unijeti tekst poruke!.<BR>"; }
%rec = &get_record($in{$db_key});
if (!%rec) { $message .= "e-mail adresa na koju zelite poslati mail ne postoji.<BR>"; }
if (!$rec{'mail'}) { $message .= "Doticna osoba ne posjeduje e-mail.<BR>" }
if ($message) {
chomp($message);
&html_send_email_form($message);
return;
}
open (MAIL, $mailprog) | &cgierr("unable to open mail program");
print MAIL "To: $rec{'mail'}\n";
print MAIL "From: $in{'email'}\n";
print MAIL "Subject: $in{'subject'}\n\n";
print MAIL "-" x 75 . "\n\n";
print MAIL "\n\n";
$line_length = 60;
while (length($in{'emailmessage'}) > $line_length) {
$i = $line_length;
# Find the end of the last word that will stay on the line
while (substr($in{'emailmessage'},$i,1) ne " ") {
--$i;
}
# Add the line to the array
push(@messages, substr($in{'emailmessage'},0,$i));
# Delete the line from the message
substr($in{'emailmessage'},0,$i+1) = '';
}
# Add the last bit of the message to the array
push(@messages,$in{'emailmessage'});
# Print out the lines
foreach $message_line (@messages) {
print MAIL "$message_line\n";
}
print MAIL "\n\n";
print MAIL " Ovu poruka je poslana Vama sa TkoJeTko site-a, najveceg \n";
print MAIL " pretrazivaca osoba u Hrvatskoj! http://www.webart.hr/tkojetko/ \n\n";
print MAIL " Posjetite i ostale WebArt siteove na http://www.webart.hr \n\n\n";
print MAIL " (c) Copyright Web Art d.o.o. 1998, 1999 \n";
close (MAIL);
&html_send_email_success($rec{'Ime'});
}


This is ERROR I get:
-------------------------
CGI ERROR
==========================================
Error Message : unable to open mail program
Script Location : /www/htdocs/webart/cgi-bin/tkojetko/tkojetko.cgi
Perl Version : 5.004
Setup File : default.cfg
User ID : default

Form Variables
-------------------------------------------
ID : 57
db : default
email : Mambo@webart.hr
emailmessage : Tekstic...
send_email : Posalji poruku
subject : kuraaaaac
uid :

No recipient addresses found in header
------------------------------------------------
Quote Reply
Re: Mail user mod problem! In reply to
For debugging purposes, change

print MAIL "To: $rec{'mail'}\n";

to

print MAIL "To: [your email address]\n";

When you put in your emailaddress, be sure to add a \ before the @ part --

you\@server.com

Then give it a try. That will tell me whether it's a problem with the email portion or the part where you get the email address from the database file.


------------------
JPD





Quote Reply
Re: Mail user mod problem! In reply to
I've tried as you said, but it's again the same error...

:-(
Quote Reply
Re: Mail user mod problem! In reply to
I don't know if this is causing your problem, but you have

open (MAIL, $mailprog) | &cgierr("unable to open mail program");

You only have one | character. There needs to be 2 | characters. Or, you can replace it with "or."

open (MAIL, $mailprog) or &cgierr("unable to open mail program");

Let me know if that helps. If not, I'll have to really think about this.

------------------
JPD





Quote Reply
Re: Mail user mod problem! In reply to
Yeees...

Tnx a lot... it works now...

I was broking my head for days with this error...

Again, tnx a lot...