Sign in to follow this  
Followers 0

SMTP questions

3 posts in this topic

I've done some searches but none of the topics returned really catered to my rudimentary scripting skills...

I'm trying to write a script that sends an email through my work's email system. In the AutoIT help file I've found the _INetSmtpMail script, and I'm just trying to test it out to see if I can get it to work. If I just copy the code from the help file into my script, and fill in the subject, message body, SMTP server etc., will it work?

Things is, I don't know what an SMTP server is supposed to look like. Ie, what goes in the $s_SmtpServer = field. Could anyone give me a quick example?

Also, I've been going through my boss's scripts, and it seems he uses a different approach to send automated emails:

Func _SendEmailCDO($from, $to, $cc, $subject, $body, $htmlbody, $server, $port = 25, $attachments = 0)
    $objMessage = ObjCreate("CDO.Message")
    $objMessage.From = $from
    $objMessage.To = $to
    If $cc <> "" Then $objMessage.Cc = $cc
    $objMessage.Subject = $subject
    $objMessage.TextBody = $body
    $objMessage.HTMLBody = $htmlbody
    $objMessage.Configuration.Fields.Item("") = 2
    $objMessage.Configuration.Fields.Item("") = $server
    $objMessage.Configuration.Fields.Item("") = $port

What the hell is that?

Sorry for the stupid questions but up till now most of my scripts have been used to search eBay for my dream car... Top-level coding there.

Share this post

Link to post
Share on other sites

#include <INet.au3>
_INetSmtpMail ( "", "Proph", "", "", "This is the subject","Message is in here...")

Your smtp must (usually) be the smtp of your ISP.

Some smtp's actually require you to use a valid email address and Username/Password. I think their is a modified _InetsmtpMail function somewhere on the forums that allows for many more capabilities then the built in function.

Hope this helps. Allthough I think the help file explains it much better. :P

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0