Jump to content

E-Posta Gönderme


DjTurkisH
 Share

Recommended Posts

autoit de mail qönderme var mı ? varsa nasıl yapılıyor ???

bide bu var ama qöndermiyor ??

 

Local $s_SmtpServer = "e-posta"
Local $s_FromName = "isim"
Local $s_FromAddress = "e-posta"
Local $s_ToAddress = "To eMail Address"
Local $s_Subject = "My Test UDF"
Local $as_Body[2]
$as_Body[0] = "Testing the new email udf"
$as_Body[1] = "Second Line"
Local $iResponse = _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body)
Local $iErr = @error
If $iResponse = 1 Then
    MsgBox($MB_SYSTEMMODAL, "Success!", "Mail sent")
Else
    MsgBox($MB_SYSTEMMODAL, "Error!", "Mail failed with error code " & $iErr)
EndIf
Edited by DjTurkisH
Link to comment
Share on other sites

Func _INetSmtpMailCom($s_FromName, $s_FromAddress,$s_ToAddress, $s_Subject , $as_Body , $s_AttachFiles = "",$s_Importance="Normal")
    Local $objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
    $objEmail.To = $s_ToAddress
    Local $i_Error = 0
    Local $i_Error_desciption = ""
    $objEmail.Subject = $s_Subject
    If StringInStr($as_Body, "<") And StringInStr($as_Body, ">") Then
        $objEmail.HTMLBody = $as_Body
    Else
        $objEmail.Textbody = $as_Body & @CRLF &@CRLF &$s_FromAddress
    EndIf
	If $s_AttachFiles <> "" Then
        Local $S_Files2Attach = StringSplit($s_AttachFiles, "|")
		For $x = 1 To $S_Files2Attach[0]
          $objEmail.AddAttachment($S_Files2Attach[$x])
		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") = "smtp.gmail.com"
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
	$objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "BURAYA ÜZERİNDEN MAİL GÖNDERİLECEK GMAİL ADRESİ"
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "BURAYA ONUN ŞİFRESİ"
    $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
    $objEmail.Configuration.Fields.Update
	;$s_Importance: High, Low, Normal değerlerini alır.
	$objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = $s_Importance
    EndSwitch
    $objEmail.Fields.Update
    $objEmail.Send
    If @error Then Return 0
    $objEmail=""
EndFunc
Link to comment
Share on other sites

  • 4 hafta sonra ...

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