ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

excel VBA MAIL¸sµo°ÝÃD

excel VBA MAIL¸sµo°ÝÃD

¤£¦n·N«ä §Ú¬O¤@个VBAªì¾ÇªÌ.·Q½Ð±Ð¤@¤U

§Ú·Q¦bEXCEL VBA³]¤@个MAIL¸sµo¤½¦¡.¦ý§Ú¥Ø«e¶È¯à°µ¨ì¦b¤@­ÓÀx¦s®æ¸Ìµo°e¤@¥÷MAIL.µLªk±N¤@­Ó½d³ò¤ºªº¦h¦ì¦¬¥óªÌ.¤@°_¸sµo.§Ú·Q­n±NB2~B5ªº¦¬¥óªÌ³£¤@°_±H¥X.¦ý¥Ø«e¤@ª½°µ¤£¨ì

¥H¤U¬O§Úªºµ{¦¡½X.
Sub sendmail()
Dim objEmail As Object
Const SMTPSERVER = "msa.hinet.net" '¨Ï¥Î msa.hinet.net 传°e邮¥ó

Set objEmail = CreateObject("CDO.Message") '«Ø¥ß CDO ª«¥ó
With objEmail.Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPSERVER
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With

objEmail.From = "[email protected]" '±H¥óªÌ¡]ÊI°ì¥²须¦s¦b¡^
objEmail.To = Range("B2").Value '¦¬¥óªÌ
objEmail.Subject = Range("E2").Value '邮¥ó¥D¦®
objEmail.HTMLBody = Range("F2").Value 'HTML邮¥ó内¤å
objEmail.Send
Set objEmail = Nothing
End Sub

½Ð°Ý¥H¤W¸Ó¦p¦ó­×§ï  

·PÁ¦U¦ì°ª¤â

¥¼©R¦W.jpg (40.43 KB)

¥¼©R¦W.jpg

¤p§Ì¬OVBA·s¤â  ½Ð¤j®a¦h¦h«ü±Ð

objEmail.To = array([b2],[b3],[b4],[b5])

TOP

Sorry,  º|¤F join(Array....., "; ")

TOP

Sub sendmail()
Dim objEmail As Object
Const SMTPSERVER = "msa.hinet.net" '¨Ï¥Î msa.hinet.net 传°e邮¥ó

Set objEmail = CreateObject("CDO.Message") '«Ø¥ß CDO ª«¥ó
With objEmail.Configuration.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPSERVER
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With


Dim arr  '°²³]±z±N[B2]©¹¤U§@¬°¦¬¥ó¤H¥i¨Ó­Ó°ÊºA¤@ÂI:
arr = Range("b2:b" & [a65536].End(3).Row)
For i = 1 To UBound(arr)
    recipients = recipients & arr(i, 1)
Next

objEmail.From = "[email protected]" '±H¥óªÌ¡]ÊI°ì¥²须¦s¦b¡^
objEmail.To = Mid(recipients, 2) '¦¬¥ó¸s
objEmail.Subject = Range("E2").Value '邮¥ó¥D¦®
objEmail.HTMLBody = Range("F2").Value 'HTML邮¥ó内¤å
objEmail.Send
Set objEmail = Nothing
End Sub

TOP

¦^´_ 3# ikboy


    ¤j¤j  ±zªº¤èªk¦³¥Î   ¤Ó¦n¤F  «D±`·P¿E±z

:D
¤p§Ì¬OVBA·s¤â  ½Ð¤j®a¦h¦h«ü±Ð

TOP

        ÀR«ä¦Û¦b : ¤@­Ó¤Hªº§Ö¼Ö¡D¤£¬O¦]¬°¥L¾Ö¦³±o¦h¡A¦Ó¬O¦]¬°¥L­p¸û±o¤Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD