Solved

Jmail Login

Posted on 2004-04-23
8
1,995 Views
Last Modified: 2012-05-04
Hello all,

I am using JMail to send emails.  I need to change the configuration to send the email from a different server.  I have the details of the server, but I dont know the syntax to state the login and password.

This is my existing code:

loMail = CREATEOBJECT("jmail.smtpmail")
loMail.serveraddress = <serveraddress>
loMail.sender = <senderaddress>
loMail.addRecipient("test@test.com")
loMail.subject = "This is a test"
loMail.Body = "This is a test"
loMail.Silent=.T.
lbRetVal = loMail.execute()
RELEASE loMail

I assume it would be something like:
loMail.ServerUserName = <username>
loMail.ServerPassword = <password>

But this does not work...

Please can anyone let me know the correct syntax for this.

Thanks
0
Comment
Question by:charlotte1
  • 4
  • 3
8 Comments
 
LVL 11

Expert Comment

by:Slimshaneey
ID: 10900146
I dont think you need to use username and password, you should just have to allow relaying on the smpt server for the IP address your mail is coming from and you should be fine...
0
 
LVL 11

Expert Comment

by:Slimshaneey
ID: 10900190
If you do need to use the username and password you can try this though:
loMail.MailServerUserName = "SomeUserName"
loMail.MailServerPassWord = "SomePassword"
0
 

Author Comment

by:charlotte1
ID: 10900289
I have tried this, but I get the error message "Unknown Member".

Unfortunately I do need to use a login and password as the mail server is not on our network, but it is an internet service.
0
 
LVL 11

Expert Comment

by:Slimshaneey
ID: 10900314
I think the login details are only available on the pro version, ie the one you pay for. Looks like you will have to open relays on the smtp server for your web server ip or fork out the cash for the object.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:charlotte1
ID: 10900325
Please can you explain how I would do this.

Thanks
0
 

Author Comment

by:charlotte1
ID: 10900348
I mean, how I would open relays on the SMTP Server for our web server IP
0
 
LVL 11

Accepted Solution

by:
Slimshaneey earned 250 total points
ID: 10900388
In IIS, right click on your SMTP node, click properties. Go to the Access tab, and at the bottom click the Relay... Button. A pop up will appear, enter the ip address of your web server in the first box and bob's your uncle, you can send emails again...
0
 
LVL 31

Expert Comment

by:alorentz
ID: 10900511
Why don't you just use CDOSYS instead of JMail, it's free and comes with Windows, and you can relay it off any SMTP servers that allow it.

CDO runs on Windows 2003, CDONTs does not.


Code below works, I use it: uses port 25, no configuration. Had problem with configuration on local machine.

strTo = "toemail@yourdomain.com"    'Make sure the From field has no spaces.
strFrom = "fromemail@yourdomain.com"
strSubject = "Your Subject"
strBody = "The content of email"


' Create an instance of the NewMail object.
Set objCDOMail = Server.CreateObject("CDO.Message")
   
' Set the properties of the object
objCDOMail.Sender = StrFrom
objCDOMail.To = strTo
objCDOMail.Subject = strSubject
objCDOMail.TextBody = strBody


' Some of the more useful ones I've included samples of here:
'objCDOMail.Cc = "mailto:sschofield@aspfree.com;steve@aspfree.com"   Notice this sending to more than one person!
'objCDOMail.Bcc = "sschofield@aspfree.com;steve@aspfree.com"
'objCDOMail.Importance = 1

'objCDOMail.AttachFile "c:\path\filename.txt", "filename.txt"

' Send the message!
objCDOMail.Send

' Set the object to nothing because it immediately becomes
' invalid after calling the Send method + it clears it out of the Server's Memory.
Set objCDOMail = Nothing
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now