DCCD Posted February 28, 2009 Share Posted February 28, 2009 (edited) Name: Sending email using DNS server MailMessage msg = new MailMessage(); msg.From = "sender@mail.com"; msg.To = "use1@mail.com;user2@mail.com"; msg.Subject = "dns sending"; msg.Body = "it is a test."; DnsMailClient client = new DnsMailClient(); client.Send(msg); thanks.. Edited July 28, 2009 by DCCD [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group Link to comment Share on other sites More sharing options...
CrewXp Posted February 28, 2009 Share Posted February 28, 2009 i need some help here? Convert C# to AU3 Name: Sending email using DNS server MailMessage msg = new MailMessage(); msg.From = "sender@mail.com"; msg.To = "use1@mail.com;user2@mail.com"; msg.Subject = "dns sending"; msg.Body = "it is a test."; DnsMailClient client = new DnsMailClient(); client.Send(msg); thanks.. Read the help file dude, its really useful. _INetMail is what you're looking for. Link to comment Share on other sites More sharing options...
toxicvn Posted February 28, 2009 Share Posted February 28, 2009 (edited) it is : expandcollapse popup$S_SMTPSERVER = "smtp.gmail.com" $S_FROMNAME = "fo you" $S_FROMADDRESS = "sender@mail.com" $S_TOADDRESS = "use1@mail.com" $S_SUBJECT = "it is a test." $AS_BODY = "dns sending" ;$S_ATTACHFILES = FileOpenDialog("", "", "", 1) ;MsgBox(0,"",$S_ATTACHFILES) $S_CCADDRESS = "user2@mail.com" $S_BCCADDRESS = "" $S_USERNAME = "your name" $S_PASSWORD = "" $IPPORT =465;25;465 $SSL = 1 _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) 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 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 $OBJEMAIL.Configuration.Fields.Update $OBJEMAIL.Send If @error Then SetError(2) Return $OMYRET[1] EndIf EndFunc Edited February 28, 2009 by toxicvn Link to comment Share on other sites More sharing options...
DCCD Posted February 28, 2009 Author Share Posted February 28, 2009 That helps a lot .... thanks everybody [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now