Jump to content

SMTP questions


AutoMT
 Share

Recommended Posts

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("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    $objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $server
    $objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $port
    $objMessage.Configuration.Fields.Update
    $objMessage.Send    
EndFunc

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.

Link to comment
Share on other sites

#include <INet.au3>
_INetSmtpMail ( "smtp.sbcglobal.net", "Proph", "Proph@someEmail.net", "AutoMT@yourEmail.net", "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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...