Sockets Email Problem Not Sent

Started by Kewun, Oct 07, 2016, 04:06 PM

Previous topic - Next topic

Kewun

this is what i tried
function onScriptLoad()
{
g_Sender <- "[email protected]";
g_Rcver <- "[email protected]";
g_Subject <- "idk";
g_Message <- "works or not";

SendMail();
print("done")
}

function SendMail()
{
g_MailSocket <- NewSocket( "ProcessMail" );
g_MailSocket.SetNewConnFunc( "ConnEstablished" );
g_MailSocket.SetLostConnFunc( "CloseConnection" );
g_MailSocket.Connect( "-clip-", 25 );

g_Timer <- NewTimer( "CloseConnection", 2500, 1 );
}

function ConnEstablished()
{
g_MailSocket.Send( "HELO localhost\n" );
g_MailSocket.Send( "MAIL FROM: " + g_Sender + "\n" );
g_MailSocket.Send( "RCPT TO: " + g_Rcver + "\n" );
g_MailSocket.Send( "DATA\n" );
g_MailSocket.Send( "SUBJECT: " + g_Subject + "\n" );
g_MailSocket.Send( "\n" );
g_MailSocket.Send( g_Message + "\n" );
g_MailSocket.Send( ".\n" );
g_MailSocket.Send( "QUIT\n" );
}

function CloseConnection()
{
if ( g_MailSocket ) g_MailSocket.Delete();
g_Timer.Delete();
}


the email wasnt sent, i checked. but prints "done"
any help? i took those functions from digging in lu website

socket plugin is loaded!

Anik

use "mail" function if using linux

Kewun


KAKAN

#3
Where is the ProcessMail function? The socket might be searching for it, and might have not worked due to the lack of that function.
oh no

Kewun

i think you mean ProcessMail function

i dont know where is it, i found this part of code so i trought it might work

KAKAN

Try using IP address instead of domain name, it might do the trick.
oh no


Thijn

Does that actually work using something like telnet?

e.g. Is your SMTP at fault or your script.

KAKAN

Quote from: Thijn on Oct 09, 2016, 04:32 PMe.g. Is your SMTP at fault or your script.
Its simply Google blocking him for using a old kind of authentication method. I remember that there's an option in google's mail settings to enable it though :p
oh no

Thijn

Quote from: KAKAN on Oct 10, 2016, 05:43 AM
Quote from: Thijn on Oct 09, 2016, 04:32 PMe.g. Is your SMTP at fault or your script.
Its simply Google blocking him for using a old kind of authentication method. I remember that there's an option in google's mail settings to enable it though :p
If he's indeed using the gmail smtp server that will never work because
1. You need to login
2. You need SSL

But we don't know that since he removed essential parts of his code.

Kewun

i still dont know how to fix it
p.s im making this for lu :/

KAKAN

Quote from: Arkhanths on Nov 21, 2016, 09:15 PMi still dont know how to fix it
p.s im making this for lu :/
You still haven't gave us what we need, incase we want it to debug.
oh no

Xmair

This is VCMP's forum not LU's.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

Rhytz

I'd use a service like Mailgun if I wanted to send mail from my server

Kewun

Quote from: KAKAN on Nov 22, 2016, 01:41 AM
Quote from: Arkhanths on Nov 21, 2016, 09:15 PMi still dont know how to fix it
p.s im making this for lu :/
You still haven't gave us what we need, incase we want it to debug.
Problem is when i use the code the email is  not sent