Click on email address

I have this little script that send email to a list of people from an input file. What I will like to do is make the "Replyto" name as  clickable.

 
  'option explicit 
 
    Dim oSession        ' AS NotesSession 
    Dim strServer 
    Dim strUserName 
    Dim strMailDbName 
    Dim oCurrentMailDb  ' as NOTESDATABASE 
    Dim oMailDoc        ' as NOTESDOCUMENT 
    Dim ortItem         ' as NOTESRICHTEXTITEM 
    Dim ortAttacment    ' as NOTESRICHTEXTITEM 
    Dim oEmbedObject    ' as ???? 
    Dim cstrAttachment 
    Dim emailaddress
    Dim filename
    Dim blAttachment 
    Dim objFSO

    Set objFSO = CreateObject("Scripting.FileSystemObject")

    SourceFile      = "d:\??????\emailaddress.txt"
    arremailaddress = Split(objFSO.OpenTextFile(sourcefile).ReadAll,vbNewLine)
    cstrAttachment  = "d:\??????\test.pdf"

For each emailaddy in arremailaddress

    blAttachment = true 
 
    Set oSession = CreateObject("Notes.NotesSession") 
 
    strServer = oSession.GetEnvironmentString("MailServer",True) 
    
    strUserName = oSession.UserName 
 
    strMailDbName = Left(strUserName, 1) & Right(strUserName, (Len(strUserName) - InStr(1, strUserName, "")))&".nsf" 
  
    set oCurrentMailDb = oSession.CurrentDatabase 
 
    If oCurrentMailDb.IsOpen = True Then 
        ' Already open for mail 
    Else 
        oCurrentMailDb.OPENMAIL 
    End If 
    Set oMailDoc = oCurrentMailDb.CREATEDOCUMENT 
 
    OMailDoc.form = "Memo"  
     emailMessage = "Contact ?????? for all queries" & vbcrlf
    'emailmessage = emailmessage & "Line2" & vbcrlf
    'emailmessage = emailmessage & "Line3" & vbcrlf
    'emailmessage = emailmessage & "Line4" & vbcrlf
   
    with oMailDoc 
        .Principal = "CN=GDT IT Support/OU=GDT IT Support/O=GDYR"
        .SendTo  = ucase(emailaddy)
        .ReplyTo = "?????@?????.com"
        .Subject = "Test for ?????"  
        .Body    = emailmessage
    end with 
 
'    set ortItem = oMaildoc.CREATERICHTEXTITEM("Body") 
'    with ortItem 

'    End With 
 
    If blAttachment Then
        Set ortAttacment = oMailDoc.CREATERICHTEXTITEM("Attachment")
        Set oEmbedObject = ortAttacment.EMBEDOBJECT(1454, "", cstrAttachment, "Attachment")
    End If
    

    with oMailDoc
        .PostedDate = Now()
        .SAVEMESSAGEONSEND = "False"

        .send(False)
    end with
    
next

    ' close objects
    set oMailDoc       = nothing
    set oCurrentMailDb = nothing
    set oSession       = nothing
    Wscript.echo " Job Done"

Open in new window

Bianchi928Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

KimputerCommented:
As this is VBscript only, there are not a lot of UI elements to choose from. The next best thing is an inputbox, requiring you to type in the full email address yourself:


.ReplyTo=InputBox("Enter full email address")

Open in new window

0
Bianchi928Author Commented:
Thanks. It's not really what I was looking for. I don't want any user interaction.
0
KimputerCommented:
If you want more options, change from vbscript to vb express.
0
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
0
Bianchi928Author Commented:
I don't have any exposure to VB express.
0
Sjef BosmanGroupware ConsultantCommented:
A question and a remark.

Where do you want the ReplyTo to be clickable? In Notes? Or in the recipient's mail client? Anyway, I think that you will have a very hard time to achieve that, if it isn't there already in the mail client used.

The remark would be that I don't understand why you start the loop at line 24. The only 2 statements that have to be in the loop, essentially, are:
        .SendTo  = ucase(emailaddy)
        .Send(False)

You can reuse the NotesDocument over and over again, and all the rest seems invariant to the loop. Last but not least: if you don't have that many addresses, you don't need the loop whatsoever. The essential part being:
        .SendTo  = arremailaddress

Now, what was the real question here?
0
Bianchi928Author Commented:
I do need the loop because I have a lot of email addresses to sent to. On the other hand the
"Reply to"  will be a specific email address which I wanted to be a clickable one.
0
Sjef BosmanGroupware ConsultantCommented:
Ok, keep the loop but you can remove everything else out, Prepare the mail, then use the same NotesDocument-object every time, just change the SendTo address each time.

About the ReplyTo: Clickable where/when/by whom? In VB?
0
Bianchi928Author Commented:
Okay...Don't worry about the loop..I will sort it out.

About the ReplyTo: Clickable where/when/by whom? In VB?

Whoever receives the email should be able to click on the email address next to teh "Reply to" when they open the mail.
0
Sjef BosmanGroupware ConsultantCommented:
Whether the ReplyTo address is clickable totally depends on the email client the recipient uses. All you can do is make a MIME mail (read: HTML) and put the reply-address in the body of the mail, as a mailto:bi@anchi.xyz or so. And then hope for the best.

<link to competing site removed - GaryC123>
0
Bianchi928Author Commented:
All the associates in the companyy uses Lotus Notes. I will look at the link and get back to you.
0
Sjef BosmanGroupware ConsultantCommented:
So sorry, 'twas late...

Here's a link to an example of how to code the generation of MIME mails: http://www.experts-exchange.com//Q_28008749.html

But if everybody already uses Notes, what's wrong with the already available Reply action button??
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bianchi928Author Commented:
HI, I had a look at the link and it's pretty close to what I want to do. Now, Look at the attachment and I think this will be a simpler way to do what i want. It's the email that I received from EE and I just want to replicate something similar where teh recipient of the email could just use these hyperlink like ...

Question: Click on email address
or Click here to see if this could be your solution.

Any idea how to do that ?
Thanks
Cheers
Idea.bmp
0
Sjef BosmanGroupware ConsultantCommented:
That's the general idea of a MIME mail: the contents are HTML, so you can use TABLE-tags for makeup etc. and A-tags for links. Look at the source of the EE mail, there you'll see how the message is built up.
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
I think I misunderstood your question based on your EE example http:a39557690.

That is simply putting a link in the html portion of your email.

  'emailmessage = emailmessage & "<a href=""www.mydomain.com/full_url.html"">Click Here</a>" & vbcrlf

Open in new window

0
Sjef BosmanGroupware ConsultantCommented:
Should be a mailto link, like this:

     <a href="mailto:tom.sawyer@yourcorp.xyz">click here</a>
0
Bianchi928Author Commented:
Thanks for that. I'll give it a go. How do you look at the sourse of the EE email ?
0
Sjef BosmanGroupware ConsultantCommented:
View/Show/PageSource...
0
Bianchi928Author Commented:
Very helpful
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.