Solved

Sending Mail alternatives

Posted on 2004-09-03
10
204 Views
Last Modified: 2010-05-02
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
Comment
Question by:MrPan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 8

Expert Comment

by:bukko
ID: 11971928
Have you tried sending using CDONTS?
0
 
LVL 8

Expert Comment

by:bukko
ID: 11971944
0
 
LVL 2

Author Comment

by:MrPan
ID: 11972107
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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 11972136
You can use http://www.freevbcode.com/ShowCode.asp?ID=109 with a SMTP server that allows realying.
0
 
LVL 18

Expert Comment

by:JR2003
ID: 11972144
Can't you set the .username property to set the user you want to send the mail from?
0
 
LVL 2

Author Comment

by:MrPan
ID: 11972297
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
 
LVL 2

Author Comment

by:MrPan
ID: 11972458
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
 
LVL 2

Author Comment

by:MrPan
ID: 12356144
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
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12574127
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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to debug this code 7 65
Advice in Xamarin 21 120
adding "ungroup sheets" to existing vbs code 5 75
"Failed to convert parameter value from a String to a Decimal." 4 42
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question