Jump to content

Any UDF's for sending emails with attachments?


lolp1
 Share

Recommended Posts

  • Developers

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 etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

#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

Link to comment
Share on other sites

  • Developers

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 etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...