|
-
May 5th, 2005, 08:22 AM
#1
Thread Starter
Fanatic Member
Multiple attachments with VBSendMail (SMTP Send Mail for VB6.0)
Hello everyone. I am using SMTP Send Mail for VB6.0. Everythig works great except I am only able to send one attachment at a time. Does anyone know how I can send 2 attachments with an email using this component?
Here is my code.
VB Code:
poSendMail.Subject = "Profit and loss statement."
poSendMail.Attachment = "C:\P&L-" & Trim(Reports.Combo3.Text) & "-" & Trim(Reports.Combo1.Text) & ".pdf"
poSendMail.Attachment = "C:\ServiceAnalysis-" & Trim(Reports.Combo3.Text) & "-" & Trim(Reports.Combo1.Text) & ".pdf"
poSendMail.Send
Set poSendMail = Nothing
The preceding code just sends the 2nd attached file, not the first one.
I also tried posendmail.attachment file1 & "," & file2. This doesn't work either. I also tried it with a semicolon instead of a comma.
Thanks
-
May 5th, 2005, 08:28 AM
#2
Re: Multiple attachments with VBSendMail (SMTP Send Mail for VB6.0)
This link demonstrates how to send mail with multiple attachments using VBSendMail.
Note: I found it through Goggle, but have not actually used it.
-
May 6th, 2005, 08:06 AM
#3
Thread Starter
Fanatic Member
Re: Multiple attachments with VBSendMail (SMTP Send Mail for VB6.0)
Thanks Hack, I found that same article and tried the comma separater but it did not work for me.
-
May 6th, 2005, 09:01 AM
#4
Re: Multiple attachments with VBSendMail (SMTP Send Mail for VB6.0)
 Originally Posted by indydavid32
Thanks Hack, I found that same article and tried the comma separater but it did not work for me.
As you just posted a snippet of the code, I'm not sure if you are doing this or not, but the routine begins with: set poSendMail = new vbSendMail.clsSendMail
Are you doing the Set statement?
-
May 6th, 2005, 03:29 PM
#5
Thread Starter
Fanatic Member
Re: Multiple attachments with VBSendMail (SMTP Send Mail for VB6.0)
Hack, here is my code. Nothing fancy.
VB Code:
Set poSendMail = New vbSendMail.clsSendMail
poSendMail.SMTPHost = "202.101.8.61"
poSendMail.POP3Host = "202.101.8.61"
poSendMail.From = st
Debug.Print strEmail
poSendMail.Recipient = strEmail
poSendMail.ReplyToAddress = st
poSendMail.Subject = "Profit and loss statement - Store #" & Trim(Combo3.Text)
st1 = "C:\P&L-" & Trim(Reports.Combo3.Text) & "-" & Trim(Reports.Combo1.Text) & ".pdf"
st2 = "C:\Expenses-" & Trim(Reports.Combo3.Text) & "-" & Trim(Reports.Combo1.Text) & ".pdf"
poSendMail.Attachment = st1 & ", " & st1
poSendMail.Send
I get an error message that says "Run-time error '52'; Bad file name or number". In debug mode, I try the files individualy without the comma and both files attached that way. So it's not my files. It's the comma.
Thanks
Last edited by indydavid32; May 6th, 2005 at 03:37 PM.
David Wilhelm
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|