September 1, 200818 yr Hi has anyone got jmail.pl to work on fasthost? I'm currnently getting a Server Error. Many thanks David.
September 3, 200818 yr Hi mate, not sure what jmail.pl is. Is it a PHP email form your having problem with?
September 3, 200818 yr Author Hi here is the script: i normally use Formmail.pl as I use oneandone for hosting I don't have a problem with that but it wont work on fasthost. use OLE; use CGI; $jmail = CreateObject OLE "JMail.SMTPMail"; print "Content-type: text/html\n\n"; $form = new CGI; $domain = $ENV {'SERVER_NAME'}; $referer = $ENV {'HTTP_REFERER'}; $url = $referer; $url =~ s/^http:\/\///i; $url =~ s/^www\.//i; $domain =~ s/^www\.//i; $Sender = $form->param('email'); $SMTPServer = "smtp.$domain:25"; #$Recipient = "form\@$SMTPServer"; $Recipient = $form->param('recipient'); $Subject = $form->param('subject'); $Priority=1; $Header = "Originating-IP", $ENV{'REMOTE_ADDR'}; $jmail->{ServerAddress} = $SMTPServer; $jmail->{Sender} = $Sender; $jmail->{Subject} = $Subject; $jmail->AddRecipient ($Recipient); $mail_body = ''; foreach $field ($form->param) { foreach $value ($form->param($field)) { $mail_body .= "$field: $value\n"; } } $jmail->{Body} = $mail_body; $jmail->{Priority} = $Priority; $jmail->AddHeader ($Header); if ($url =~ m/^$domain/) { $mailmessage = "Mail was sent."; $jmail->Execute; } else { $mailmessage = "mail not sent. Incorrect Referer"; } print "Content-type: text\n\n"; print "Result: $mailmessage\n\n"; #print "Recipient: $Recipient\n\t\n"; #print "Sender: $Sender SMTP Server: $SMTPServer\t"; #print "Subject: $Subject Referer: $referer"; #print "Domain: $domain url: $url "; print <<"(END ERROR HTML)"; Content-type: text/html <html> <head> <title>Enquiry</title> <META HTTP-EQUIV="Refresh" CONTENT="0; URL=../thanks.html"> </head> <body> </body> </html>
Create an account or sign in to comment