Shoutbox

To send email - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: To send email (/showthread.php?tid=90754)

To send email by toto69230 on 05-23-2009 at 11:30 AM

Hello!
I would like that my script sends email to me, I have to seek on Internet and I found its:

code:
var msg = new ActiveXObject("CDO.Message");
msg.From = "Moi <me@mycomputer.invalid>";
msg.To = "Dave <devnull@ens.fr>";
msg.Subject = "Essai avec CDO.Message";
msg.TextBody = "J'essaie mon nouveau script.\n";
msg.Send();

The problem it is that msg. Send ()
is my operating system Windows Vista, it is the cause of the problem not?

RE: To send email by Jesus on 05-23-2009 at 11:34 AM

I'm not sure about this, but shouldn't msg.From and msg.To be email addresses only?


RE: To send email by NanaFreak on 05-23-2009 at 12:00 PM

quote:
Originally posted by Jesus
I'm not sure about this, but shouldn't msg.From and msg.To be email addresses only?
no it is quite fine to have it like that, PHP can have i tlike this as well...

if nobody come up with any help with this (something like what matty or cookie would normally post), i will have a look at this tomorrow what i am not capped...
RE: To send email by matty on 05-23-2009 at 05:05 PM

You are not configuring the SMTP settings for the email. The object has no idea where to send the email through if you do not specify it...

js code:
SendEmail('Script <script@msghelp.net>', 'myemail@mydomain.com', 'this is a test email', '<html><head><title>Test Title</title></head><body>Test message body</body></html>', 'smtp.mydomain.com', 25, 10);

function SendEmail(from, to, subject, body, server, port, timeout){
    var iMsg = new ActiveXObject('CDO.Message');
    var iConf = new ActiveXObject('CDO.Configuration');
    var Flds = iConf.Fields;
    var Base = 'http://schemas.microsoft.com/cdo/configuration/';
    Flds.Item(Base + 'sendusing') = 0x2 /* cdoSendUsingPort */;
    Flds.Item(Base + 'smtpserver') = server;
    Flds.Item(Base + 'smtpserverport') = port;
    Flds.Item(Base + 'smtpconnectiontimeout') = timeout;
    Flds.Update();
    iMsg.Configuration = iConf;
    iMsg.To = to;
    iMsg.From = from;
    iMsg.Subject = subject;
    iMsg.HTMLBody = body;
    iMsg.Send();
}

RE: RE: To send email by toto69230 on 05-23-2009 at 05:47 PM

Thanks you very much !