Client Login Area
LiveZilla Live Chat Software
Main Menu
Results 1 to 2 of 2

Thread: perl script, email meth. auth. help

  1. #1
    Unverified User
    Join Date
    July 11, 2008
    Posts
    1

    Default perl script, email meth. auth. help

    <P mce_keep="true">I'm trying to set up this free auction script. For some reason my emails can not be sent, received, etc. I think I need an auth. variable or something. I want to use my mail host. I guess the mail system aspnix uses needs an auth. code.Any help? Here is the code...</P>
    <P mce_keep="true">THIS IS THE CONFIG...</P>
    <P mce_keep="true"># You need to assign either a mail program or
    # a mail host so e-mails can be sent out.
    # Configure your MAIL PROGRAM</P>
    <P mce_keep="true"> $config{'get_mail'}= 1; # Set this from 1 to 0 if you want to use your own setting
    $config{'mailprog'}= '/Your/Path/To/sendmail'; # no additional options please

    # or Configure your MAIL HOST (SMTP)
    #$config{'mailhost'}= 'http://YourSMTP-Host';</P>
    <P mce_keep="true">THIS IS THE METHOD...</P>
    <P mce_keep="true">sub sendemail {
    my ($to, $from, $subject, $message) = @_;
    my ($socket, $remote, $get_back);

    if ($config{'web_server'} != 1) {
    $$message =~ s/[\r\n]/\&lt;br\&gt;/g;
    print qq|&lt;br&gt;&lt;hr size="1" noshade&gt;You are on your local server&lt;br&gt;so this is just for testing|;
    print qq|&lt;hr size="1" noshade&gt;To: $$to&lt;br&gt;From: $$from&lt;br&gt;Subject: $$subject&lt;br&gt;$$message&lt;hr size="1" noshade&gt;&lt;br&gt;|;
    return;
    }

    if ($config{'mailhost'}) {
    eval { require IO::Socket };
    $@ &amp;&amp; oops($txt{'eMail Service not available'});

    $socket = IO::Socket::INET-&gt;new(
    PeerAddr=&gt; $config{'mailhost'},
    PeerPort=&gt; 'smtp(25)',
    Proto=&gt; 'tcp'
    );

    $socket-&gt;autoflush();
    print $socket "HELO $config{'mailhost'}\015\012";
    $get_back .= &lt;$socket&gt;;
    print $socket "MAIL From:&lt;$config{'admin_address'}&gt;\015\012";
    $get_back .= &lt;$socket&gt;;
    print $socket "RCPT To:&lt;$$to&gt;\015\012";
    $get_back .= &lt;$socket&gt;;
    print $socket "DATA\015\012";
    $get_back .= &lt;$socket&gt;;
    print $socket "From: &lt;$$from&gt;\015\012Subject: $$subject\015\012\015\012";
    print $socket $$message;
    print $socket "\015\012.\015\012";
    &n

  2. #2
    ASPnix Administration Roma's Avatar
    Join Date
    June 27, 2005
    Location
    Denver, CO
    Posts
    4,066

    Default Re: perl script, email meth. auth. help

    <P mce_keep="true">You are right, our mail servers require SMTP Auth. I'm not a programmer, so hopefully anyone can help you with the code.</P>
    <P mce_keep="true">This is my favorite link, but it's only asp and asp.net http://community.aspnix.com/t/2496.aspx</P>
    Roma
    Friendly ASPnix Administrator


    https://www.aspnix.com
    roma@aspnix.com



    ASPnix on Facebook

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •