标题:程序在发送邮件的时候,如何让邮件中嵌入图片而不是作为附件发送!
只看楼主
sq19880308
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2009-6-18
结帖率:50%
已结贴  问题点数:0 回复次数:1 
程序在发送邮件的时候,如何让邮件中嵌入图片而不是作为附件发送!
程序自动发送,我需要的是代码

[ 本帖最后由 sq19880308 于 2009-8-7 09:21 编辑 ]
搜索更多相关主题的帖子: 邮件 嵌入 图片 
2009-08-06 17:35
ORDENJOYEE
Rank: 2
等 级:论坛游民
帖 子:8
专家分:37
注 册:2009-8-26
得分:30 

    Public Function ImageTo64String(ByVal Image As System.Drawing.Image) As String
        Dim S As String = ""
        If Not Image Is Nothing Then
            Dim M As New
            Image.Save(M, System.Drawing.Imaging.ImageFormat.Jpeg)
            S = Convert.ToBase64String(M.ToArray)
            M.Dispose()
        End If
        Return S
    End Function

    Public Function ImageFrom64String(ByVal [String] As String) As System.Drawing.Image
        Dim IMG As System.Drawing.Image = Nothing
        Dim BTS As Byte() = Convert.FromBase64String([String]), M As New (BTS)
        IMG = System.Drawing.Bitmap.FromStream(M)
        If Not M Is Nothing Then M.Dispose()
        BTS = Nothing
        Return IMG
    End Function

2009-08-26 22:55



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-281837-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.052443 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved