Rank: Administration
Groups: Administrators
Joined: 11/11/2010(UTC) Posts: 1,153
Thanks: 9 times Was thanked: 55 time(s) in 55 post(s)
Introduction
EASendMail is a SMTP component which supports all operations of SMTP/ESMTP protocols (RFC 821, RFC 822, RFC 2554). This tutorial covers everything of sending email with EASendMail in VB6.
A simple VB 6.0 project
Send email over SSL connection
Send email using Gmail account
Send email using Yahoo account
Send email using Hotmail/MSN Live account
Send email directly without SMTP server(MX DNS lookup)
Send HTML email
Send email with attachment
Send email with embedded images
Send email with digital signature (S/MIME)
Email encryption (S/MIME)
Send email in asynchronous mode
Send email with multiple threads (Mass Mail)
Total sample projects
Click here to read full tutorial ... If you have any comments or questions about above example codes, please add your comments here.
Edited by user Sunday, April 3, 2011 7:30:29 PM(UTC)
| Reason: Not specified
1 user thanked ivan for this useful post.
Rank: Newbie
Groups: Registered
Joined: 5/27/2012(UTC) Posts: 5 Location: My House
Thanks: 3 times
Hi guys, Is there any way you can change the sender name? I tried using: osmtp.FromAddr = "JustNameNoEmailAddress" but it doesn't send the mail, and when I looked on Outlook, the email message is saved in the Drafts Folder. (I'm using EWS) Thanks!
Rank: Administration
Groups: Administrators
Joined: 11/11/2010(UTC) Posts: 1,153
Thanks: 9 times Was thanked: 55 time(s) in 55 post(s)
markariels wrote: Hi guys, Is there any way you can change the sender name? I tried using: osmtp.FromAddr = "JustNameNoEmailAddress" but it doesn't send the mail, and when I looked on Outlook, the email message is saved in the Drafts Folder. (I'm using EWS) Thanks!
Hi, You should use
oSmtp.From = "your name"
oSmtp.FromAddr = "your address"
1 user thanked ivan for this useful post.
Rank: Newbie
Groups: Registered
Joined: 5/27/2012(UTC) Posts: 5 Location: My House
Thanks: 3 times
ivan wrote: Hi, You should use oSmtp.From = "your name" oSmtp.FromAddr = "your address"
Tried this as well (in which it successfully send the mail) but it will not change the sender's name once I read the message from Recipient's end.
Thanks anyway...
Edited by user Sunday, May 27, 2012 5:07:35 PM(UTC)
| Reason: Not specified
Rank: Administration
Groups: Administrators
Joined: 11/11/2010(UTC) Posts: 1,153
Thanks: 9 times Was thanked: 55 time(s) in 55 post(s)
markariels wrote: ivan wrote: Hi, You should use oSmtp.From = "your name" oSmtp.FromAddr = "your address"
Tried this as well (in which it successfully send the mail) but it will not change the sender's name once I read the message from Recipient's end.
Thanks anyway...
Hi, I just did a test. I am sorry to say it is a Exchange EWS limit, the sender name will be changed to the display name in AD automatically no matter you set other name in mail header.
So you have to change your display name in your Exchange Active Directory manually.
Rank: Newbie
Groups: Registered
Joined: 5/27/2012(UTC) Posts: 5 Location: My House
Thanks: 3 times
Yeah, that's what I thought! Thanks...
Rank: Newbie
Groups: Registered
Joined: 8/10/2017(UTC)
Posts: 1
Hi, Can you please let me know how to add multiple recipients in oSmtp.AddRecipientEx "support@emailarchitect.net", 0 I have list extracted from excel columns and stored in a variable, I would like to send the emails by using that variable. Please advise. Thank you!
Rank: Administration
Groups: Administrators
Joined: 11/11/2010(UTC) Posts: 1,153
Thanks: 9 times Was thanked: 55 time(s) in 55 post(s)
Originally Posted by: kkk Hi, Can you please let me know how to add multiple recipients in oSmtp.AddRecipientEx "support@emailarchitect.net", 0 I have list extracted from excel columns and stored in a variable, I would like to send the emails by using that variable. Please advise. Thank you!
You can run this method multiple times to add multiple addresses.
oSmtp.AddRecipientEx "support0@emailarchitect.net", 0
oSmtp.AddRecipientEx "support1@emailarchitect.net", 0
and ...
you can also add multiple recipients like this:
oSmtp.AddRecipientEx "support0@emailarchitect.net,
support1@emailarchitect.net ", 0
Rank: Newbie
Groups: Registered
Joined: 6/12/2018(UTC)
Posts: 1
Location: Hyderabad
Thanks: 1 times
Hi,
I am trying to run the below script on
SQL Server 2012 query analyzer that creates
'EASendMailObj.Mail' object using
'sp_OACreate' , but getting:
'-2147221005': 'Invalid class string' error.
Could you please look into this?
Script: DECLARE @hr int
DECLARE @oSmtp int
DECLARE @result int
DECLARE @description nvarchar(255)
EXEC @hr = sp_OACreate 'EASendMailObj.Mail',@oSmtp OUT
print @hr
If @hr <> 0
BEGIN
EXEC @hr = sp_OAGetErrorInfo @oSmtp, NULL, @description OUT
IF @hr = 0
BEGIN
PRINT @description
END
RETURN
End
Edited by user Tuesday, June 12, 2018 12:57:22 AM(UTC)
| Reason: Not specified
Rank: Administration
Groups: Administrators
Joined: 11/11/2010(UTC) Posts: 1,153
Thanks: 9 times Was thanked: 55 time(s) in 55 post(s)
Originally Posted by: smuchakurti Hi, I am trying to run the below script on SQL Server 2012 query analyzer that creates 'EASendMailObj.Mail' object using 'sp_OACreate' , but getting: '-2147221005': 'Invalid class string' error. Could you please look into this?Script: DECLARE @hr int DECLARE @oSmtp int DECLARE @result int DECLARE @description nvarchar(255) EXEC @hr = sp_OACreate 'EASendMailObj.Mail',@oSmtp OUT print @hr If @hr <> 0 BEGIN EXEC @hr = sp_OAGetErrorInfo @oSmtp, NULL, @description OUT IF @hr = 0 BEGIN PRINT @description END RETURN End
It seems that you didn't install EASendMail on the SQL server.
If SQL server is running on a remote server, you should install it on remote server as well.
1 user thanked ivan for this useful post.
Forum Jump
EmailArchitect Support
Email Component Development
- EASendMail SMTP Component - .NET Version
- EASendMail SMTP Component - Windows Store Apps
- EASendMail SMTP ActiveX Object
- EAGetMail POP3 & IMAP4 Component - .NET Version
- EAGetMail POP3 & IMAP4 ActiveX Object
Exchange Server and IIS SMTP Plugin
- DomanKeys/DKIM for Exchange Server and IIS SMTP
- Disclaimer and S/MIME for Exchange Server and IIS
EmailArchitect Email Server
- EmailArchitect Email Server (General)
- EmailArchitect Email Server Development
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.