excel - 预期:行号或标签或语句或语句结尾
问题描述
Sub Send_Email()
Dim sh As Worksheetenter code here
sh = ThisWorkbook.Sheets("CREmail")
With Selection.Parent.MailEnvelope.Item
.TO = ClientRegistration.txtemail.Value
.Subject = "Thank You for Registration"
.Attachments.Add sh, 1, 0
.HTMLBody = "<img src=""cid:WoService.png""height=520 width=750>"
"Dear" < ClientRegistration.txtname.Value >
"Thank you For Registration"
"Regards"
"Parth"
.Display
.Send
End With
MsgBox "Done"
End Sub
我想要电子邮件正文如下
中心标志“图像”
亲爱的“客户名称”'来自用户表单
欢迎来到我们的平台
问候,
帕思
解决方案
正如@braX 提到的,您需要使用&
来连接文本和_
连接行。我添加了<br/>
标签,因为它们用于 html 换行符。
尝试这个:
.Attachments.Add sh, 1, 0
.HTMLBody = "<img src=""cid:WoService.png""height=520 width=750><br/>" & _
"Dear <" & ClientRegistration.txtname.Value & "><br/>" & _
"Thank you For Registration<br/>" & _
"Regards<br/>" & _
"Parth"
.Display
.Send
推荐阅读
- python - Scipy 辛普森集成以获取值数组
- amazon-web-services - Amazon SP-API(卖家合作伙伴 api)- CreateInboundShipmentPlan 和 CreateInboundShipment 之间的数量是否必须匹配
- python-3.x - 根据email列分组的pandas数据框的email列发送邮件
- postgresql - 按条件连接字符串
- recursion - BST树实现问题
- r - 如何让我的图例点变成蓝色和红色,而不是两者都是红色?
- photoshop - 如何在 Photoshop (UXP) 中绘制路径?
- sms - SMPP 客户端连接但不发送短信
- angular - Fullcalendar 角度不同日期的不同 maxtime
- linux - 如何在 google chrome ubunutu 中允许默认的 xdg-open 应用程序