CDO Messaging中的HTML:同一行上的图像

时间:2015-01-03 02:57:47

标签: html css image email cdo.message

我有一个简单的vbs可以发送带有图片的电子邮件。问题是,我无法获得我想要的格式。我需要将图像对齐在同一行,我也尝试使用div对齐但仍然得到相同的结果。

非常感谢你!


Set RE = CreateObject("VBScript.RegExp")

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "two attached pic"
objMessage.From = "email@yahoo.com" 
objMessage.To = "email@yahoo.com" 
objMessage.HtmlBody="<h><body><b>Before</b></h><br><br><br><img src=1.jpg style=width:304px;height:228px><br><br><br><b>After</b></h><br><br><br><img src=2.jpg style=width:304px;height:228px><br></body></html>" 
Set objBP = objMessage.AddRelatedBodyPart("C:\Users\A&P IT\Desktop\edkbr\wallpaper\1.jpg", "1.jpg", 1)
objBP.Fields.Item("urn:schemas:mailheader:Content-ID") = "<1.jpg>"
Set objBP = objMessage.AddRelatedBodyPart("C:\Users\A&P IT\Desktop\edkbr\wallpaper\2.jpg", "2.jpg", 1)
objBP.Fields.Item("urn:schemas:mailheader:Content-ID") = "<2.jpg>"
objBP.Fields.Update

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername")="email@yahoo.com"
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword")="password"
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.gmail.com"
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=465
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")=1
objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl")=1
objMessage.Configuration.Fields.Update

objMessage.Send
Set objMessage = Nothing

0 个答案:

没有答案