Jump to content

Autoit Le Mail Göndermek


mustafakara
 Share

Recommended Posts

sevgili arkadaşlar ben yaptığım bir programa mail gönderme bölümü eklemek istiyorum
mail göndermeyle alakalı kodlar elimde var ancak nedense gmail üzerinden gönderiyor ancak
hotmail üzerinden göndermiyor
her ikisindende gönderebileceğim bir kod yazabilirmisiniz bana
teşekkürler
Link to comment
Share on other sites

Verdiğim adreste gerekli SMTP ayarları yazılı.

http://windows.microsoft.com/tr-tr/windows/outlook/send-receive-from-app (POP3 ve SMTP'yi destekleyen uygulamalar)

 

 

gmailin smtp adresi falan belli outlookunkini bilmiyorum. ama hangi mail üzerinden gönderdiğinin bir önemi yok ki gönderen kısmına istediğin bilgiyi girebilirsin sonuçta.


Hocam olmayan adresten nasıl e-posta gönderebiliriz? Belki vardır öyle bir şey ama ben bilmiyorum.

Kolay gelsin.

Edited by reyiz
Link to comment
Share on other sites

işte arkadaşlar bu örnekle gmail üzerinden gönderebiliyorum ama hotmail de olmuyor yardımcı olursanız memnun olurum

örnek:



#Include<file.au3>



$ToAddress = "[email protected]" ; destination address of the email - REQUIRED
$FromName = "mustafa karabunar"
$Subject = "önemli"
$Body = "mail deneme"
$AttachFiles = "c:\\boot.ini" ; the file you want to attach- leave blank if not needed

$Importance = "high" ; Send message priority: "High", "Normal", "Low"

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

_BL_SEND_GMAIL($ToAddress,$FromName,$Subject,$Body,$AttachFiles,$Importance)

Func _BL_SEND_GMAIL($ToAddress,$FromName = "",$Subject = "",$Body = "",$AttachFiles = "",$Importance = "Normal")
Local $SmtpServer = "smtp.gmail.com" ; address for the smtp-server to use - REQUIRED
Local $Username = "benim adresim"
Local $Password = "benim şifrem"
;~ Local $IPPort = 25 ; port used for sending the mail
;~ Local $ssl = 0 ; enables/disables secure socket layer sending - put to 1 if using httpS
;~ Local $CcAddress = "[email protected]" ; address for cc - leave blank if not needed
;~ Local $BccAddress = "[email protected]" ; address for bcc - leave blank if not needed
Local $CcAddress = "" ; address for cc - leave blank if not needed
Local $BccAddress = "" ; address for bcc - leave blank if not needed
Local $IPPort=465 ; GMAIL port used for sending the mail
Local $ssl=1 ; GMAILenables/disables secure socket layer sending - put to 1 if using https
Local $FromAddress = $Username & "@gmail.com"

Local $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl)
If @error Then
MsgBox(0, "Mesaj gönderilirken hta oluştu", "Error code:" & @error & " Description:" & $rc)
EndIf
EndFunc

; The UDF
Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance="Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0)
Local $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])
ConsoleWrite('@@ Debug(62) : $S_Files2Attach = ' & $S_Files2Attach & @LF & '>Error code: ' & @error & @LF) ;### Debug Console
If FileExists($S_Files2Attach[$x]) Then
$objEmail.AddAttachment ($S_Files2Attach[$x])
Else
ConsoleWrite('!> File not found to attach: ' & $S_Files2Attach[$x] & @LF)
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
If Number($IPPort) = 0 then $IPPort = 25
$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
; Set Email Importance
Switch $s_Importance
Case "High"
$objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "High"
Case "Normal"
$objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Normal"
Case "Low"
$objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Low"
EndSwitch
$objEmail.Fields.Update
; Sent the Message
$objEmail.Send
If @error Then
SetError(2)
Return $oMyRet[1]
EndIf
$objEmail=""
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

Link to comment
Share on other sites

malesef hotmail de bu dediğiniz yok
durumumdan dolayı belki ben fark edemedim diye başka arkadaşa baktırdım
ancak seçenekler içersinde sadece silmeye ilişkin böyle bir ayara rastladık
arkadaşlar en azından yukarıdaki örnek üzerinden yardımcı olabilirmisiniz

Link to comment
Share on other sites

arkadaşlar
ipport u 25 ten 587 yaptığımda sunucu gönderenin adresini redetti sunucunun yanıtı
530.5.0 start tls command gibi bir yanıt alıyorum
port 25 te ise sunucuya bağlanamadı yanıtı alıyorum lütfen yardım
sanıyorum tls yi eklemem gerekecek nasıl yaparım

Link to comment
Share on other sites

Local $SmtpServer ="smtp.live.com"
Local $IPPort="587"

Local $ssl=1  ; bunu 1 yada 0 olarak deneyiniz

 

 

en yukarıdaki ayarları değiştirip deneyiniz

aşağıdaki port 25 oynamayınız

böyle deneyiniz lakin msn bu destegi sağlamıyor diyor

eğer çalışırsa kodları paylaşırsanız memnun oluruz

kolay gelsin

Link to comment
Share on other sites

önerdiğiniz ayarların hepsini daha önce denedim
malesef çalışmıyor
autoit formlarınada baktım herşey aynı neden bilmiyorum ama olmuyor
bu konuyu iyi bilen bir arkadaş mail alma ve mail gönderme hakkında bilgi berirse memnun olacağız

Link to comment
Share on other sites

hotmail ile örnek paylaşırmısın reyiz gözünü seveyim önceden yapıyordu

lakin şimdi bu desteği sağlamııyor

ama protokol ve destekten gerekli ayarları yapılırsa bilemem

kod olarak hotmail ile çalışan yok gibi bence

hotmali yada live bu servisi sağlıyorsa

kodlarını paylaşınız

kolay gelsin

Link to comment
Share on other sites

arkadaşlar herkese teşekkürler tatil nedeniyle konunun takipçisiolamadım
o yüzden örneklere ancak şimdi bakıyorum ilk olarak
SwithMail.exe programına baktım ancak uygulama düzgün başlayamadı iletisi aldım
diğer verilen linklere bakacağım
teşekkürler bilen bir arkadaş bu konuya örnek verirse memnun olurum
herkese kolay gelsin

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...