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!
use "mail" function if using linux
im not using linux
Where is the ProcessMail function? The socket might be searching for it, and might have not worked due to the lack of that function.
i think you mean ProcessMail function
i dont know where is it, i found this part of code so i trought it might work
Try using IP address instead of domain name, it might do the trick.
k
Does that actually work using something like telnet?
e.g. Is your SMTP at fault or your script.
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
Quote from: KAKAN on Oct 10, 2016, 05:43 AMQuote 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.
i still dont know how to fix it
p.s im making this for lu :/
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.
This is VCMP's forum not LU's.
I'd use a service like Mailgun if I wanted to send mail from my server
Quote from: KAKAN on Nov 22, 2016, 01:41 AMQuote 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
Quote from: Arkhanths on Nov 22, 2016, 09:27 AMQuote from: KAKAN on Nov 22, 2016, 01:41 AMQuote 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
Our problem is we don't have ProcessMail, the most required part of your code.
Quote from: Rhytz on Nov 22, 2016, 09:20 AMI'd use a service like Mailgun if I wanted to send mail from my server
I'd use Nodemailer (https://nodemailer.com/) and Google's free SMTP server (https://support.google.com/a/answer/176600?hl=en)( How To Use Google's SMTP Server (https://www.digitalocean.com/community/tutorials/how-to-use-google-s-smtp-server) by DigitalOcean (https://www.digitalocean.com/) ) instead.
You need to atleast get rid of g_MailSocket.SetLostConnFunc( "CloseConnection" ); because SetNewConnFunc and SetLostConnFunc don't work together in LU. (http://mantis.liberty-unleashed.co.uk/view.php?id=137)
You should also create a function to check the response from the server.
Quote from: KAKAN on Nov 22, 2016, 09:32 AMQuote from: Arkhanths on Nov 22, 2016, 09:27 AMQuote from: KAKAN on Nov 22, 2016, 01:41 AMQuote 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
Our problem is we don't have ProcessMail, the most required part of your code.
Quote from: Rhytz on Nov 22, 2016, 09:20 AMI'd use a service like Mailgun if I wanted to send mail from my server
I'd use Nodemailer (https://nodemailer.com/) and Google's free SMTP server (https://support.google.com/a/answer/176600?hl=en)( How To Use Google's SMTP Server (https://www.digitalocean.com/community/tutorials/how-to-use-google-s-smtp-server) by DigitalOcean (https://www.digitalocean.com/) ) instead.
my problem is i dont have the ProcessMail function and i need some example script for sending email
I think you're gonna have a hard time getting it to work like this either way... Most, if not all SMTP servers require authentication, and communicate using SSL/TLS nowadays, and thats tricky/impossible to work with using just the socket functions available in LU/VCMP.