Jump to content
Sign in to follow this  
lolp1

Any UDF's for sending emails with attachments?

Recommended Posts

lolp1

Is there any UDF's or some already-written code of sending an email with an attachment - or do I need to wip something up my self?

Share this post


Link to post
Share on other sites
lolp1

Look for _INetSmtpMailCom() in the examples forum ..

<_<

Looks nice

$s_SmtpServer = "MailServer" ; address for the smtp-server to use - REQUIRED

Which infos would go here for hotmail?

Share this post


Link to post
Share on other sites
lolp1

Hi well I tried a few things and I can't seem to even get it to succsfully send an email let a lone an attachment. Any nice examples?

Share this post


Link to post
Share on other sites
Jos

Hi well I tried a few things and I can't seem to even get it to succsfully send an email let a lone an attachment. Any nice examples?

Its in the thread where I posted this UDF and it works fine for me ...

Maybe you can show the code that call this UDF ?

What OS/IE versions are you running on ?

<_<

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
lolp1

#Include<file.au3>
#include<twst.au3>

$s_SmtpServer = "smtp.gmail.com"; address for the smtp-server to use - REQUIRED
$s_FromName = "**"; name from who the email was sent
$s_FromAddress = "**@gmail.com";  address from where the mail should come
$s_ToAddress = "***@hotmail.com"; destination address of the email - REQUIRED
$s_Subject = "Userinfo"; subject from the email - can be anything you want it to be
$as_Body = "Oo"; the messagebody from the mail - can be left blank but then you get a blank mail
$s_AttachFiles = "lol.txt"; the file you want to attach- leave blank if not needed
$s_CcAddress = ""; address for cc - leave blank if not needed
$s_BccAddress = ""; address for bcc - leave blank if not needed
$s_Username = "Slammedd@gmail.com"; username for the account used from where the mail gets sent - REQUIRED
$s_Password = "**"; password for the account used from where the mail gets sent - REQUIRED
$IPPort=465; port used for sending the mail
$ssl=1; enables/disables secure socket layer sending - put to 1 if using httpS

Global $oMyRet[2]
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
$rc = _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, "")
If @error then
    msgbox(0,"Error sending message","Error code:" & @error & "  Description:" & $rc)
EndIf

Share this post


Link to post
Share on other sites
Jos

pretty sure you are missing some parameters. this is a line from the posted example:

$rc = _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, $s_AttachFiles, $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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  

×