Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

Sending Mail alternatives

Hi I am in charge of a software application that needs to send and receive emails containing data.

The program gives two alternatives for mail smtp (via easymail objects) and MAPI.

The problem that I have is that for the easymail objects to work relaying needs to be turned on for authenicated users. Some of my customers are not willing to do this. For this reason with have a MAPI option. The problem that I have is that with MAPI I cannot send mail from anyone but the defualt profile. I have looked onto threads here and none of them appears to have an answer that just appear to fizzle out.

What I need is either a means of sending mail via mapi which is not the default profile or an alternate means that does not need relaying turned on. My mapi code is as follows.

Sub sendMail(User As String)
        'Use MAPI
        With MAPISession1
            .NewSession = True
            .UserName = User 'this is the outlook profile
            '.Password = passwrord
            .DownLoadMail = False
            .LogonUI = True
            .SignOn
            MAPIMessages1.SessionID = .SessionID
        End With
        With MAPIMessages1
            .Compose
            .RecipType = mapToList
            .RecipAddress = "zzzzzzzzz@hotmail.com"
               
            .MsgNoteText = User & " " & CStr(Now())
            .MsgSubject = "Electronic Filing " & User
           
            .ResolveName
            .Send False
        End With
        'MainMessage "Disconnecting from Mail Server"
        MAPISession1.SignOff
End Sub

I am testing this on a windows 2000 machine, using mail accounts that are remote hosted via fasthosts. I have set outlook as my default mail client. I also have outlook express and Lotus Notes installed.

Any help would be greatly appreciated.
0
MrPan
Asked:
MrPan
1 Solution
 
bukkoCommented:
Have you tried sending using CDONTS?
0
 
MrPanAuthor Commented:
Thanks for the response but there is nothing on the thread that answers my questions.

CDONTS still needs relaying and it is worse then my easymail objects as it needs unauthenticated relaying. I have not tried this but read it on your link

The links on MAPI do not offer anything either. Any other suggestions.

The solution needs to be generic to work for 500+ customers regardless of their email systems.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Éric MoreauSenior .Net ConsultantCommented:
You can use http://www.freevbcode.com/ShowCode.asp?ID=109 with a SMTP server that allows realying.
0
 
JR2003Commented:
Can't you set the .username property to set the user you want to send the mail from?
0
 
MrPanAuthor Commented:
I set it to different mail profiles but when I go into outlook the mail is waiting in my outbox the from address is blank, if i hit send receive the mail is sent from my default profile.
0
 
MrPanAuthor Commented:
emoreau

The problem is that the mail has to come from the customer and  is being sent to a government department. It is an electronic form of data transfer.

I have been down the mail servers that allow relaying in the past, which works fine until they are blacklisted.

I was suprised the code worked without any passwords, I assume some servers may treat this as spam\relaying.



0
 
MrPanAuthor Commented:
I have found the answer myself.

My code works if you use profiles within the mail. YOu need to turn on profiles in Outlook. Outlook express will only send from the default account.
0
 
moduloCommented:
Closed, 500 points refunded.

modulo
Community Support Moderator
Experts Exchange
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now