wodSmtpServer - sending mail to local multiple rec - WeOnlyDo Discussion board

wodSmtpServer - sending mail to local multiple rec (wodSmtpServer / wodPop3Server / wodImapServer)

by nisha, Thursday, July 17, 2008, 08:40 (5756 days ago)

Hi,
I want to send the mail to multiple local recipients. and i have used User.filename and User.FileAppend as true. it creates msg file for only sigle recipient not for all the recipients.

I also tried to add msgs using Mailbox in MailStart event. it's also not working to have solution.

Pls help for the same.

Thanks

Re: wodSmtpServer - sending mail to local multiple

by woddrazen, Thursday, July 17, 2008, 09:03 (5756 days ago) @ nisha

Hi Nisha,


Did you try using our Samples? I would suggest you to try VB\Component\1. Simple sample. You can find it in component Samples folder.

If you want to save all emails in one file code in 1. Simple sample MailStart Event should be same as code in MailTo Event. It works for me.

Can you please try that and let us know how it goes.


Regards,
Drazen

Re: wodSmtpServer - sending mail to local multiple

by nisha, Thursday, July 17, 2008, 09:28 (5756 days ago) @ woddrazen

Hi,

Thanks for quick response.

I have tried from smaple too. Actually i want to store msgs/file per User. (Multiple msgs for individual user)

when i write the below code in MailTo event, it works well if recipient is single..

User.Message.Filename = PATH + username/recipientname;
User.Message.FileAppend = true;
User.Message.Tag = username/recipientname;

But the problem arises when there are multiple recipients (In this case i want to create muliple files per each user) ..and it creates the msg file for last user/recipient only..NOT for all the recipients..

I need help for above.
Thanks.

Re: wodSmtpServer - sending mail to local multiple

by woddrazen, Thursday, July 17, 2008, 10:40 (5756 days ago) @ nisha

Nisha,


Can you please try this:
[code]Private Sub wodSmtpServer1_MailStart(ByVal User As WODSMTPSERVERCOMLib.ISmtpUser)
User.Message.FileName = C:\Messages.txt
User.Message.FileAppend = True
End Sub[/code]

Drazen

Re: wodSmtpServer - sending mail to local multiple

by nisha, Thursday, July 17, 2008, 11:29 (5756 days ago) @ woddrazen


Hi,

This above code works same as my current code. it creates the Message.txt.. But i want to create multiple msg files (eg if there are 3 recipients (in mail To list) as user1, user2, user3 then user1.txt, user2.txt, user3.txt should be created.)

Thanks

Re: wodSmtpServer - sending mail to local multiple

by woddrazen, Thursday, July 17, 2008, 12:02 (5756 days ago) @ nisha

Nisha,


Something like this?
[code]Private Sub wodSmtpServer1_MailStart(ByVal user As WODSMTPSERVERCOMLib.ISmtpUser)
Dim username As String
username = Mid(user.Message.MailTo, 2, (InStr(1, user.Message.MailTo, @ ) - 2))

user.Message.FileName = c:\ + username + .txt
user.Message.FileAppend = True
End Sub[/code]
Drazen

Re: wodSmtpServer - sending mail to local multiple

by nisha, Thursday, July 17, 2008, 12:11 (5756 days ago) @ woddrazen

Hi,
Yes, exactly , i have applied the similar logic. but msg file is created once the MailStart event gets executed..so it creates only one username.txt instead of 3 users (even if we execute for loop for each username)

Thanks

Re: wodSmtpServer - sending mail to local multiple

by woddrazen, Thursday, July 17, 2008, 12:12 (5756 days ago) @ nisha

Nisha,


But this works for me, can you please send email to techsupport@weonlydo.com and I will send you my sample.


Drazen