Jump to content

SMTP server


 Share

Recommended Posts

Hi, I have a mail script that works. Currently it is using a gmail account as SMTP server (smtp.gmail.com) - But because alot of people use my program alot of e-mails are being send and gmail things that its spam so he blocks it and tells me that im making too much traffic. So now I want to use my SMTP server from my own e-mail address: mail.hostsupply.nl, I put the port to 25 and SLL off plus I enter the correct login information. But when I run it I get the error:

Error code: 2 Description: can't be send to SMTP-server. Errorcode is 0x800ccc67. Reaction from server: 421 - Cannot connect to SMTP server 195.248.77.10 (195.248.77.10:25), connect error 10060

My mail script:

#Include<file.au3>
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
;##################################
; Include
;##################################
#Include<file.au3>
;##################################
; Variables
;##################################
$s_FromName = "Glider Pro"                  ; name from who the email was sent
$s_FromAddress = "contact@hostsupply.nl";  address from where the mail should come
$s_ToAddress = "to@me.com" ; destination address of the email - REQUIRED
$s_Subject = "Subject"               ; subject from the email - can be anything you want it to be
$as_Body = "Tekst"                      ; 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 = "username"                  ; username for the account used from where the mail gets sent - REQUIRED
$s_Password = "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
;~ $IPPort=465                        ; GMAIL port used for sending the mail
;~ $ssl=1                           ; GMAILenables/disables secure socket layer sending - put to 1 if using httpS

; mail.au3, mail2.au3, mail3.au3, mail4.au3



;##################################
; Script
;##################################
Global $oMyRet[2]
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

$DefaultSmtpServer = "mail.hostsupply.nl"

$rc = _INetSmtpMailCom($DefaultSmtpServer, $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=25, $ssl=0)
    $objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
    $objEmail.To = $s_ToAddress
    Local $i_Error = 0
    Local $i_Error_desciption = ""
    If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress
    If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress
    $objEmail.Subject = $s_Subject
    If StringInStr($as_Body,"<") and StringInStr($as_Body,">") Then
        $objEmail.HTMLBody = $as_Body
    Else
        $objEmail.Textbody = $as_Body & @CRLF
    EndIf
    If $s_AttachFiles <> "" Then
        Local $S_Files2Attach = StringSplit($s_AttachFiles, ";")
        For $x = 1 To $S_Files2Attach[0]
            $S_Files2Attach[$x] = _PathFull ($S_Files2Attach[$x])
            If FileExists($S_Files2Attach[$x]) Then
                $objEmail.AddAttachment ($S_Files2Attach[$x])
            Else
                $i_Error_desciption = $i_Error_desciption & @lf & 'File not found to attach: ' & $S_Files2Attach[$x]
                SetError(1)
                return 0
            EndIf
        Next
    EndIf
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort
;Authenticated SMTP
    If $s_Username <> "" Then
        $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username
        $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password
    EndIf
    If $Ssl Then
        $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
    EndIf
;Update settings
    $objEmail.Configuration.Fields.Update
; Sent the Message
    $objEmail.Send
    if @error then
        SetError(2)
        return $oMyRet[1]
    EndIf
EndFunc;==>_INetSmtpMailCom
;
;
; Com Error Handler
Func MyErrFunc()
    $HexNumber = Hex($oMyError.number, 8)
    $oMyRet[0] = $HexNumber
    $oMyRet[1] = StringStripWS($oMyError.description,3)
    ConsoleWrite("### COM Error !  Number: " & $HexNumber & "   ScriptLine: " & $oMyError.scriptline & "   Description:" & $oMyRet[1] & @LF)
    SetError(1); something to check for when this function returns
    Return
EndFunc;==>MyErrFunc
Edited by tom13
Link to comment
Share on other sites

  • Developers

Please, can anyone help me? :)

Or does anyone otherwise knows a free mail service without SMTP traffic limit? (gmail and bluebottle do have these limits)

You have not been very clear why you need to sent so many messages....

No to answer your own question: why do you think there is a limit ?

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

You have not been very clear why you need to sent so many messages....

No to answer your own question: why do you think there is a limit ?

Hi,

I made a program that automatically sends log files of a bot to the user's e-mail address. Because I don't want them to need their own SMTP server I insert mine, but now like 40 people are sending e-mails on the same SMTP server all the time.

Thats why I want to use my own mail address for SMTP (mail.hostsupply.nl) but for some reason this isn't working, do you know why?

EDIT: I also tried GMAIL and Bluebottle, but after some hours they both blocked my account for sending too much traffic I think, or too many connections..

Edited by tom13
Link to comment
Share on other sites

No one believes your cover story...

:)

Seriousely you make me sick... First I have to explain WHY I want to do this, then I explain it and you say its not true =_=

This is a support forum if i'm not mistaken, remember?

Link to comment
Share on other sites

  • Developers

Seriousely you make me sick... First I have to explain WHY I want to do this, then I explain it and you say its not true =_=

This is a support forum if i'm not mistaken, remember?

its your own doing since you have been unclear from the start and still are.

Give me one good reason to meail the result of some process to somebodies mailfile while you can just as simple create an local log file and leave it on the PC.

oh and regular SMTP servers do not use userid/password, only secured SMTP like GMail uses require it, but they will have all kinds of anti relay features in place to avoid spam relaying.

You are asking for support on something we cannmot help you with... the script is correct as you stated already .. so nothing to fix there.

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

its your own doing since you have been unclear from the start and still are.

Give me one good reason to meail the result of some process to somebodies mailfile while you can just as simple create an local log file and leave it on the PC.

oh and regular SMTP servers do not use userid/password, only secured SMTP like GMail uses require it, but they will have all kinds of anti relay features in place to avoid spam relaying.

You are asking for support on something we cannmot help you with... the script is correct as you stated already .. so nothing to fix there.

Do you know a public SMTP server?

I don't need to spam at all... Only need to send alot of messages a day but not fast after eachother

Link to comment
Share on other sites

Do you know a public SMTP server?

I don't need to spam at all... Only need to send alot of messages a day but not fast after eachother

A word of advice. See that "Moderator" label under JdeB's name? Don't press the issue. He's already told you that you're asking something that we can't help you with.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

A word of advice. See that "Moderator" label under JdeB's name? Don't press the issue. He's already told you that you're asking something that we can't help you with.

That makes no sence, first its said that those SMTP servers excist and then that I can't be helped with the question if anyone knows them... Would be really amazing of you to know that none knows any of these servers, wouldn't it?

Link to comment
Share on other sites

  • Developers

That makes no sence, first its said that those SMTP servers excist and then that I can't be helped with the question if anyone knows them... Would be really amazing of you to know that none knows any of these servers, wouldn't it?

Its not easy for you to just shut up ..is it?

Have you read my last post and did you understand any of it ?

Either way... don't answer that.

Oh and the answer to your PM where you "ask" why the other thread is closed:

In this thread you state that this script works with ssl/Gmail. In the other thread you ask how to make that script work ... Do I need to explain more ? (Don't think so)

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

That makes no sence, first its said that those SMTP servers excist and then that I can't be helped with the question if anyone knows them... Would be really amazing of you to know that none knows any of these servers, wouldn't it?

Valik, you have a customer at thread #45108...

:)

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Its not easy for you to just shut up ..is it?

Have you read my last post and did you understand any of it ?

Either way... don't answer that.

Oh and the answer to your PM where you "ask" why the other thread is closed:

In this thread you state that this script works with ssl/Gmail. In the other thread you ask how to make that script work ... Do I need to explain more ? (Don't think so)

Ok you guys are looking for something after everything I see.

Well since my goal is NOT spamming I'll explain it again.

I'm working on a program that adds extra features to a popular bot for World of Warcraft, called Glider (http://mmoglider.com)

The program checks the bot's log files and then decides what to do, one of the new features is mailing the log files of the bot whenever an error or whisper from another player occurs. The program is already released here: http://vforums.mmoglider.com/showthread.ph...0523#post410523

It's called Glider PRO, at the moment i'm working on version 3.0 that solves the SMTP problems it has at the moment.

I hoped that this (friendly, as I thought) community would be here to help me but I see that I first have to explain everything i'm doing before you can think a person is doing anything good.

Anyway, I hope this cleared enough for you to make it look like this topic is posted in a support forum again.

PS. why I asked questions about both scripts? Well, I could have used the first one, but after I was going to use Bluebottle I didnt need SSL and a special PORT. So, I integrated the second script. But because I'm wanting to switch to gmail again and then let everyone create their own accounts instead of 1 big SMTP account I was wanting to get SSL and a special port back. But because it costs me alot of time to remove the second script from the latest version again and then integrate the first script again it was easier for me to keep the second script and change it abit (with your help)

So.... you might aswell have some more "good thinking" about others to be honest

EDIT: i guess i'll just integrate the first script again then, probably won't get much help here anyway

Edited by tom13
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...