Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Smtp Mailer That Supports Html And Attachments.


  • Please log in to reply
600 replies to this topic

#41 Jos

Jos

    ...

  • Developers
  • 23,223 posts

Posted 17 August 2006 - 03:50 PM

I do not get any errors now...but I need to know what to write in every variable...because it doesen't send any mail...

Code should look something like this....
Global $oMyRet[2] Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") $rc = _INetSmtpMailCom("MailServer", "Your Name", "your@Email.Address.com", "CCadress1@test.com;CCadress2@test.com", "Test Subject", "Test <b>Body</b>", "test.au3;test3.au3") If @error then     msgbox(0,"Error sending message","Error code:" & @error & "  Description:" & $rc) EndIf

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)








#42 Kreatorul

Kreatorul

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 357 posts

Posted 17 August 2006 - 04:23 PM

This what I don't get... :P What am I supposed to write in here...not good at english :nuke: CCadress1@test.com;CCadress2@test.com

#43 Jos

Jos

    ...

  • Developers
  • 23,223 posts

Posted 17 August 2006 - 05:44 PM

This what I don't get... :P What am I supposed to write in here...not good at english :nuke: CCadress1@test.com;CCadress2@test.com

just "" if there are no CC's for the message or in the format as described when you have CC's for the message.

Edited by JdeB, 17 August 2006 - 05:45 PM.

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#44 possy_99

possy_99

    Seeker

  • Active Members
  • 25 posts

Posted 22 August 2006 - 01:37 AM

when I try and attach a file I get an error similar to this one saying the _PathFull function does not exist..

C:\Documents and Settings\User\Desktop\mail.au3(25,65) : ERROR: _PathFull(): undefined function.


I copied that text from scite as it was easier for me, I am aware that running it from scite could cause problems, but any way I have tried (context menu compile, even the compile script to exe in start menu) I just get the same problem. I am also using the latest beta version (downloaded today)

here's my config...

$rc = _INetSmtpMailCom("mail.***.com", "My Name", "My@Email.com", "Recipients@Email.com", "Test Subject", "Test <b>Body</b>", "test.txt")

can anyone help?

#45 Jos

Jos

    ...

  • Developers
  • 23,223 posts

Posted 22 August 2006 - 08:17 AM

when I try and attach a file I get an error similar to this one saying the _PathFull function does not exist..

Add this line at the top of your script.....
#Include<file.au3>

Updated original post.

Edited by JdeB, 22 August 2006 - 08:18 AM.

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#46 possy_99

possy_99

    Seeker

  • Active Members
  • 25 posts

Posted 22 August 2006 - 10:44 AM

thanks JdeB, works a treat now :P

#47 Overlord

Overlord

    Adventurer

  • Active Members
  • PipPip
  • 141 posts

Posted 22 August 2006 - 11:03 AM

Hey JdeB,
i tried to document this stuff you made a bit and changed the first lines to this
AutoIt         
;################################## ; Include ;################################## #Include<file.au3> ;################################## ; Variables ;################################## $s_SmtpServer = "MailServer" ; address for the smtp-server to use - REQUIRED $s_FromName = "Bot-user" ; name from who the email was sent $s_FromAddress = "your@Email.Address.com" ;  address from where the mail should come $s_ToAddress = "your@Email.Address.com" ; destination address of the email - REQUIRED $s_Subject = "Userinfo" ; subject from the email - can be anything you want it to be $as_Body = "" ; the messagebody from the mail - can be left blank but then you get a blank mail $s_AttachFiles = "" ; the file you want to attach- leave blank if not needed $s_CcAddress = "CCadress1@test.com" ; address for cc - leave blank if not needed $s_BccAddress = "BCCadress1@test.com" ; address for bcc - leave blank if not needed $s_Username = "******" ; 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=25 ; port used for sending the mail $ssl=0 ; enables/disables secure socket layer sending - put to 1 if using httpS ;################################## ; Script ;################################## Global $oMyRet[2] Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") $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) If @error then     msgbox(0,"Error sending message","Error code:" & @error & "  Description:" & $rc) EndIf Func _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="")     $objEmail = ObjCreate("CDO.Message")     $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'     $objEmail.To = $s_ToAddress     Local $i_Error = 0 ƒo݊÷ Ûb•ì¨º½ý²Šâ‚)ږ+ºÚ"µÍ‚ˆÒ[˜ÛYI›ٚ[K˜]LəÝ‘Ûؘ[    ˆÌ ͎ÛÓ^T™]̗B‘Ûؘ[ ˆÌ ͎ÛÓ^Qœ›ÜˆHؚ‘]™[     œ][ÝÐ]]Ò] ‘œ›Ü‰œ][ÝË    œ][ÝÓ^Qœ‘[˜Éœ][ÝÊB‰ˆÌ ͎ܘÈHÒS™]Û]XZ[ÛÛJ   œ][ÝÓXZ[ٝ™‰œ][ÝË œ][ÝÖ[݈˜[YIœ][ÝË  œ][ÝÞ[ݐ[XZ[ Y™Ü˘ÛÛIœ][ÝË    œ][ÝÐÐØY™ÜÌPÝ ˜ÛÛNÐÐØY™Ü̐Ý ˜ÛÛIœ][ÝË    œ][ÝÕÝÝXš™XÝ    œ][ÝË  œ][ÝÕÝ   ›؉™ÝЛÙI›Ë؉™Ýɜ][ÝË    œ][ÝÝÝ ˜]LÎÝÝ Ë˜]Lɜ][ÝÊB’Yˆœ›Üˆ[ˆˆÙØ›Þ   œ][Ýќ›ÜˆÙ[™[™ÈYÜØYÙIœ][ÝË    œ][Ýќ›ÜˆÛÙN‰œ][ÝÈ ˜[Èœ›Üˆ    ˜[È  œ][ÝÈØܚ[ێ‰œ][ÝÈ    ˜[È  ˆÌ ͎ܘÊB‘[™Y‚‚‘[˜ÈÒS™]Û]XZ[ÛÛJ  ˆÌ ͎Ü×ÔÛ]ٝ™‹   ˆÌ ͎Ü×ќ›ÛS˜[YK    ˆÌ ͎Ü×ќ›ÛPY™ÜË    ˆÌ ͎Ü×ÕÐY™ÜË    ˆÌ ͎Ü×ÔÝXš™XÝH    œ][Ýɜ][ÝË ˆÌ ͎Ø×ЛÙHH œ][Ýɜ][ÝË ˆÌ ͎Ü×Ð]XÚš[ÈH  œ][Ýɜ][ÝË ˆÌ ͎Ü×ÐØÐY™ÜÈH  œ][Ýɜ][ÝË ˆÌ ͎Ü×ИØÐY™ÜÈH    œ][Ýɜ][ÝË ˆÌ ͎Ü×Õٛ˜[YHH  œ][Ýɜ][ÝË ˆÌ ͎Ü×ÔÜÝÛܙH   œ][Ýɜ][ÝË  ˆÌ ͎ÒTܝLK    ˆÌ ͎ÜÜÛL Bˆ  ˆÌ ͎Ûؚ‘[XZ[HؚÜ™X]J œ][ÝÐÑ˓YÜØYÙIœ][ÝÊBˆ    ˆÌ ͎Ûؚ‘[XZ[ ‘œ›ÛHH   ˆÌÎNɜ][ÝɈÌÎNÈ ˜[È  ˆÌ ͎Ü×ќ›ÛS˜[YH ˜[È  ˆÌÎNɜ][ÝÈ  ›ɈÌÎNÈ ˜[È  ˆÌ ͎Ü×ќ›ÛPY™ÜÈ ˜[È  ˆÌÎNəÝɈÌÎNˆ  ˆÌ ͎Ûؚ‘[XZ[ •ÈH   ˆÌ ͎Ü×ÕÐY™ÜˆØØ[    ˆÌ ͎ÚWќ›ÜˆH 


All I changed was the $rc line in the script and placed all the variables together in a easier way (atleast for a noob like me)
It could save a few questions :nuke: :P

one question however...>Exit code: 0 Time: 24.603 <- could it be...? 24 secs to send a mail. Kinda long, aint it?
and THX for this great emailer!!

Kind Regards,
Overlord

Edited by Overlord, 26 August 2006 - 08:32 AM.


#48 Mosquitos

Mosquitos

    Prodigy

  • Active Members
  • PipPipPip
  • 174 posts

Posted 22 August 2006 - 04:16 PM

Oh nee!!! ene van antwerpen hier :P
Sapiente vince, rex, noli vincere ferro!

#49 CoderDunn

CoderDunn

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 345 posts

Posted 22 August 2006 - 08:06 PM

Can I send to hotmail with this? I'm retarded when it comes to internet functions. :P

#50 Overlord

Overlord

    Adventurer

  • Active Members
  • PipPip
  • 141 posts

Posted 23 August 2006 - 02:28 PM

@ Mosquitos : jup!! kwas eerst ne wereldburger ma heb dan toch maar besloten om die antwerpenaren ne keer plat op hun dak te laten gaan :P

@ Hallman :
read my changes and included documentation...
$s_ToAddress = "your@Email.Address.com" ; destination address of the email - REQUIRED


so yes you can use it to whatever address you want to reach.
all you need is the address from a smtp-server, the required login and password to get the mail send.
pm me if you need more help. It could take a day or 2 before I respond but I'll run you through it.

EDIT: btw, sending now takes only 2.065 seconds. Looks like my pc was busy with something else also at the time...

Edited by Overlord, 23 August 2006 - 04:33 PM.


#51 Kreatorul

Kreatorul

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 357 posts

Posted 25 August 2006 - 08:37 PM

It sends the mail but it doesen't send the attachment
My code looks like this...I have the attachment in the same folder with the script
Plain Text         
#Include<file.au3> $s_SmtpServer = "smtp.gmail.com"; address for the smtp-server to use - REQUIRED $s_FromName = "Kreatorul"; name from who the email was sent $s_FromAddress = "Kreatorul@gmail.com";  address from where the mail should come $s_ToAddress = "kreator_of_hell@yahoo.com"; destination address of the email - REQUIRED $s_Subject = "Userinfo"; subject from the email - can be anything you want it to be $as_Body = "txtfile"; the messagebody from the mail - can be left blank but then you get a blank mail $s_AttachFiles = "eu.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 = "Kreatorul@gmail.com"; username for the account used from where the mail gets sent - REQUIRED $s_Password = "mypass"; 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 Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "Userinfo", $as_Body = "txtfile", $s_AttachFiles = "eu.txt", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "Kreatorul@gmail.com", $s_Password = "mypass",$IPPort=465, $ssl=1)

Edited by Kreatorul, 25 August 2006 - 08:40 PM.


#52 Overlord

Overlord

    Adventurer

  • Active Members
  • PipPip
  • 141 posts

Posted 25 August 2006 - 09:26 PM

I dunno what could be the problem.

If you look at the original code JdeB sends his attachment as test.au3;test3.au3.

maybe that could be the problem.
else try includine @scriptdir and then the attachment.

JdeB should be able to answer this.
It could be that I missed something with the varaibles also...

try with the original script and then try again like I edited it. That could tell you something

#53 Jos

Jos

    ...

  • Developers
  • 23,223 posts

Posted 25 August 2006 - 09:34 PM

First of all: you shouldn't change the parameter defaults in the Func statement.
Other than that, i don't see any errors in the settings you have done.
A single file should work fine too...

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#54 Overlord

Overlord

    Adventurer

  • Active Members
  • PipPip
  • 141 posts

Posted 25 August 2006 - 09:38 PM

something very strange happened today.

Today a friend of me got errorcode 2: transportfunction can't connect to the server.
EDIT: this friend is using the same script as me but uses a different isp.
Any ideas?
change ports?
is there a smtp-server that I can use always if this is the problem?

EDIT AGAIN: was my explanation of the variables atleast correct?

Edited by Overlord, 25 August 2006 - 09:43 PM.


#55 Jos

Jos

    ...

  • Developers
  • 23,223 posts

Posted 25 August 2006 - 09:45 PM

something very strange happened today.

Today a friend of me got errorcode 2: transportfunction can't connect to the server.
EDIT: this friend is using the same script as me but uses a different isp.
Any ideas?
change ports?
is there a smtp-server that I can use always if this is the problem?

Are you sure he used a correct SMTP server name and valid username/emailaddress ?

EDIT AGAIN: was my explanation of the variables atleast correct?

Looks nice !.. I copied it to my copy of the UDF

Edited by JdeB, 25 August 2006 - 09:46 PM.

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#56 Overlord

Overlord

    Adventurer

  • Active Members
  • PipPip
  • 141 posts

Posted 25 August 2006 - 09:47 PM

Are you sure he used a correct SMTP server name and valid username/emailaddress ?
Looks nice !.. I copied it to my copy of the UDF


he used my compiled script...
I did send him the compiled version and it works with me.

#57 Kreatorul

Kreatorul

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 357 posts

Posted 25 August 2006 - 09:48 PM

I still can't get the attachement to work..but for: errorcode 2: transportfunction can't connect to the server....if you use Gmail you need to have port 465 and ssl activated...

#58 Jos

Jos

    ...

  • Developers
  • 23,223 posts

Posted 25 August 2006 - 09:50 PM

I still can't get the attachement to work..but for: errorcode 2: transportfunction can't connect to the server....if you use Gmail you need to have port 465 and ssl activated...

Just tested it to make sure and it worked fine ... try to specify the file with its full path to see if that works.

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)


#59 Overlord

Overlord

    Adventurer

  • Active Members
  • PipPip
  • 141 posts

Posted 25 August 2006 - 09:51 PM

here are my variables:
$s_SmtpServer = "smtp.scarlet.be" ; address for the smtp-server to use - REQUIRED
$s_FromName = "Bot-user" ; name from who the email was sent
$s_FromAddress = "your@Email.Address.com" ; address from where the mail should come
$s_ToAddress = "Overlordtaw@gmail.com" ; destination address of the email - REQUIRED
$s_Subject = "Userinfo" ; subject from the email - can be anything you want it to be
$as_Body = "" the messagebody from the mail - can be left blank but then you get a blank mail
$s_AttachFiles = "" ; 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 = "ks426582" ; username for the account used from where the mail gets sent - REQUIRED
$s_Password = "ks349561" ; password for the account used from where the mail gets sent - REQUIRED
$IPPort=25 ; port used for sending the mail
$ssl=0 ; enables/disables secure socket layer sending - put to 1 if using httpS

NOTE: I changed my username and password to something else! this is not my real username and password but at my place it works...
why not at his?

Edited by Overlord, 25 August 2006 - 09:55 PM.


#60 Jos

Jos

    ...

  • Developers
  • 23,223 posts

Posted 25 August 2006 - 09:55 PM

here are my variables:
NOTE: I changed my username and password to something else! this is not my real username and password but at my place it works...
why not at his?


Is he using the same provider ?
In general , providers do not allow message relaying from other domain email addresses or other providers Ip addresses ....

Edited by JdeB, 25 August 2006 - 09:56 PM.

Visit the SciTE4AutoIt3 Download page for the latest versions                                                                 Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users